(
_: IpcMainInvokeEvent,
fileBuffer: ArrayBuffer,
filename: string
)
| 336 | } |
| 337 | |
| 338 | export 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 | |
| 362 | export async function uploadToFilebin( |
| 363 | _: IpcMainInvokeEvent, |
nothing calls this directly
no test coverage detected