CopyPastor

Detecting plagiarism made easy.

Score: 0.8333731775653773; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2020-10-22
by Raj Navadiya

Original Post

Original - Posted on 2018-06-05
by Jackyef



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Triggering browser download from front-end is not reliable.
What you should do is, create an endpoint that when called, will provide the correct response headers, thus triggering the browser download.
Front-end code can only do so much. The 'download' attribute for example, might just open the file in a new tab depending on the browser.
The response headers you need to look at are probably Content-Type and Content-Disposition. You should check this answer for more detailed explanation.
Triggering browser download from front-end is not reliable.
What you should do is, create an endpoint that when called, will provide the correct response headers, thus triggering the browser download.
Front-end code can only do so much. The 'download' attribute for example, might just open the file in a new tab depending on the browser.

The response headers you need to look at are probably `Content-Type` and `Content-Disposition`. You should check this [answer][1] for more detailed explanation.

[1]: https://stackoverflow.com/a/20509354/4662933

        
Present in both answers; Present only in the new answer; Present only in the old answer;