happy-opfs
    Preparing search index...

    Function uploadFile

    • Uploads a file from the specified path to a URL.

      This API is built on @happy-ts/fetch-t.

      Parameters

      • filePath: string

        The path of the file to upload.

      • uploadUrl: string | URL

        The URL where the file will be uploaded.

      • OptionalrequestInit: UploadRequestInit

        Optional request initialization parameters.

      Returns FetchTask<Response>

      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 upload
      task.abort();