MCPcopy Create free account
hub / github.com/ScattrdBlade/bigFileUpload / uploadTo0x0

Function uploadTo0x0

utils/upload.ts:694–711  ·  view source on GitHub ↗
(fileBlob: Blob, filename: string)

Source from the content-addressed store, hash-verified

692}
693
694async function uploadTo0x0(fileBlob: Blob, filename: string): Promise<string> {
695 if (!Native) {
696 throw new Error("0x0.st uploads are only supported on the desktop client");
697 }
698
699 const arrayBuffer = await fileBlob.arrayBuffer();
700 const result = await Native.uploadTo0x0(arrayBuffer, filename);
701
702 if (!result.success) {
703 throw new Error(result.error || "Upload failed");
704 }
705
706 if (!result.url) {
707 throw new Error("No URL returned from upload");
708 }
709
710 return result.url;
711}
712
713async function uploadToLitterbox(fileBlob: Blob, filename: string): Promise<string> {
714 const expiry = settings.store.litterboxExpiry || "24h";

Callers 1

uploadToServiceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected