Forked from easrng/uploadTo0x0
Public
Script
1
2
3
4
5
6
7
8
9
10
11
export async function uploadTo0x0(data, name) {
const blob = new Blob([data]);
const formData = new FormData();
formData.append("file", blob, name);
formData.append("expires", "1");
const response = await fetch("https://0x0.st", {
method: "POST",
body: formData,
});
return await response.text();
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
April 18, 2024