MCPcopy Create free account
hub / github.com/bitiful/send / upload

Function upload

app/page.tsx:26–39  ·  view source on GitHub ↗
(url: string, file: File, onProgress: (event: ProgressEvent<EventTarget>) => void)

Source from the content-addressed store, hash-verified

24 }
25
26 function upload(url: string, file: File, onProgress: (event: ProgressEvent<EventTarget>) => void) {
27 return new Promise((res, rej) => {
28 const xhr = new XMLHttpRequest();
29 xhr.open('PUT', url);
30
31 xhr.onload = e => {
32 res("")
33 };
34 xhr.onerror = rej;
35 if (xhr.upload && onProgress)
36 xhr.upload.onprogress = onProgress;
37 xhr.send(file);
38 });
39 }
40
41 useEffect(() => {
42 if (file === null) return

Callers 1

uploadFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…