Open andy-yu-y opened 1 year ago
I am also facing the same issue.
Hi am not an expert but you probably provide a link in the wrong way:
1) It should be full URL where the browser automatically sets the correct Content-Type
headers
saveAs( "https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg", "cat.jpeg" );
2) Or wrap it to blob/file
var blob = new Blob(["some text"], { type: "text/plain;charset=utf-8;", });
saveAs(blob, "thing.txt");
const saveFolder = () => { FileSaver.saveAs( 'serverurl/proj/otbstorage/logs/sched-432cc428-ddae-11ed-bad5-662cc6ee3b0c/mb_output_ids.txt', 'a.txt', ); };
Above is my code, instead of download the file, the browser directly open the file. I google a lot recently, it may caused by fetching file from serverurl not localhost. But i can not find any way to fix this. Can anyone take a look and help about this issue?