Uploads a file from the specified path to a URL.
This API is built on @happy-ts/fetch-t.
@happy-ts/fetch-t
timeout
onProgress
The path of the file to upload.
The URL where the file will be uploaded.
Optional
Optional request initialization parameters.
A task that can be aborted and contains the result of the upload.
1.0.6
const task = uploadFile('/documents/report.pdf', 'https://example.com/upload');(await task.result) .inspect(() => console.log('File uploaded successfully'));// Abort the uploadtask.abort(); Copy
const task = uploadFile('/documents/report.pdf', 'https://example.com/upload');(await task.result) .inspect(() => console.log('File uploaded successfully'));// Abort the uploadtask.abort();
Uploads a file from the specified path to a URL.
This API is built on
@happy-ts/fetch-t.timeoutandonProgressvia UploadRequestInit