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

Function uploadToTempSh

native.ts:338–360  ·  view source on GitHub ↗
(
    _: IpcMainInvokeEvent,
    fileBuffer: ArrayBuffer,
    filename: string
)

Source from the content-addressed store, hash-verified

336}
337
338export async function uploadToTempSh(
339 _: IpcMainInvokeEvent,
340 fileBuffer: ArrayBuffer,
341 filename: string
342): Promise<NativeUploadResult> {
343 try {
344 const response = await multipartFetch("https://temp.sh/upload", {}, "file", fileBuffer, filename);
345
346 if (!response.ok) {
347 const errorText = await response.text();
348 return { success: false, error: `Upload failed: ${response.status} ${errorText}` };
349 }
350
351 const url = (await response.text()).trim();
352 if (!url) {
353 return { success: false, error: "No URL returned from upload" };
354 }
355
356 return { success: true, url };
357 } catch (e) {
358 return { success: false, error: e instanceof Error ? e.message : "Unknown error" };
359 }
360}
361
362export async function uploadToFilebin(
363 _: IpcMainInvokeEvent,

Callers

nothing calls this directly

Calls 2

multipartFetchFunction · 0.85
textMethod · 0.80

Tested by

no test coverage detected