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

Function uploadToS3

native.ts:168–186  ·  view source on GitHub ↗
(
    _: IpcMainInvokeEvent,
    fileBuffer: ArrayBuffer,
    uploadUrl: string,
    headers: Record<string, string>
)

Source from the content-addressed store, hash-verified

166}
167
168export async function uploadToS3(
169 _: IpcMainInvokeEvent,
170 fileBuffer: ArrayBuffer,
171 uploadUrl: string,
172 headers: Record<string, string>
173): Promise<NativeUploadResult> {
174 try {
175 const response = await rawFetch(uploadUrl, "PUT", fileBuffer, headers);
176
177 if (!response.ok) {
178 const errorText = await response.text();
179 return { success: false, error: `Upload failed: ${response.status} ${errorText}` };
180 }
181
182 return { success: true, url: uploadUrl };
183 } catch (e) {
184 return { success: false, error: e instanceof Error ? e.message : "Unknown error" };
185 }
186}
187
188export async function uploadToCatbox(
189 _: IpcMainInvokeEvent,

Callers

nothing calls this directly

Calls 2

rawFetchFunction · 0.85
textMethod · 0.80

Tested by

no test coverage detected