Switch single-file dataset downloads to use browser native downloads
- Dominant language
- Scala
- Stars
- 314
- Forks
- 187
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 214
Description
**Issue**
This issue re-addresses part of a larger issue, https://github.com/apache/texera/issues/3404, which describes how the download of workflow results and datasets (both single-file and multi-file downloads) does not trigger any progress indicator by the browser. This issue specifically addresses single-file dataset downloads.
Absence of a progress indicator means that, for large files, users see no feedback about the download progress until the file suddenly finishes downloading. This creates poor user experience because it causes uncertainty about the download status.
Currently, the frontend:
- Requests a pre-signed URL from the backend for the dataset file
- Makes a request on the pre-signed URL to fetch the file into JavaScript memory as a Blob
- Writes the Blob to the local filesystem, setting the filename and filetype
Because the download is handled programmatically in JavaScript instead of by the browser, the browser’s download UI is not shown.
**Fix**
To switch single-file dataset downloads to use browser-based downloads, we can create a hidden link element () in the frontend that points to the pre-signed URL and programmatically click it, instead of sending a request to the URL. This lets the browser handle the file transfer and display its native download UI.
However, the current pre-signed URL is generated through the LakeFS API, which doesn’t support custom headers such as `Content-Disposition`. Without this header, the browser cannot correctly set the filename and filetype, leading to generic names (e.g. 'd3eo286eh7os77u8d0k0,Gw_-cWconI7VjtJviVRvW8nHb6NvkYRSIIx6cOy-RCs' ) and MIME type. To address this issue, we can instead use the S3 Gateway API to generate the pre-signed URL, which allows for customization of headers.
Contributor guide
Assessment
This issue has not been assessed yet.