aicam commented on code in PR #9262:
URL: https://github.com/apache/texera/pull/9262#discussion_r4673311953
##########
frontend/src/app/dashboard/service/user/file/file-saver.service.ts:
##########
@@ -30,4 +30,18 @@ export class FileSaverService {
saveAs(data: Blob | string, filename?: string, options?:
FileSaver.FileSaverOptions): void {
this.saveAsFn(data, filename, options);
}
+
+ /**
+ * Hands a URL to the browser's own download manager, so the bytes stream to
disk instead of being buffered in
+ * memory first. The response must carry `Content-Disposition: attachment`,
otherwise the browser navigates to it.
+ */
+ saveFromUrl(url: string): void {
Review Comment:
Good catch, this is correct because frontend hand the presign-url to browser
and can not track if it actually work. Your solution for using `target="_blank`
is correct but since it opens a new browser and then click on the link, many
browsers like Safari consider it as ad and block it. To handle the situation,
we added a simple check in frontend that ask for first 0 byte and if it fail it
notify the user without running the download.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]