Download pdf from get request js
Thanks anyway. Hey russellg , I was able to read and write a PDF file as follows:. This is how my server-side PHP script looks like. Hope this helps. Nice work amit. Many thanks for posting this.
If you get a blank screen there as well, might be a problem with the pdf itself. If you do see a pdf file there and not in the downloaded file, do let me know on my email. This anchor element actually did not work for me on IE 11, Edge and Firefox. Show 7 more comments.
BalusC BalusC 1. Once again: you do not need Ajax for this. It's only asking for trouble. In some browsers the window. So, also do NOT use window. If the content-disposition is set to attachment , you will just get a Save as dialogue.
The parent page will stay unchanged. There is a limited Url length. And the author is asking about POST. Show 10 more comments.
URL window. It is reusable. Hope that helps. Georgios Syngouroglou Georgios Syngouroglou I had to set the responseType of xhr to arraybuffer or blob for this to work. Otherwise, this works great.
I had the exact same question. All the people responding "just make it a link" doesn't help the OP. If your content is dynamic and the link you are going to is dynamic, you have to jquery it all Works great. This is a great answer, but for some reason, I just keep getting broken empty PDF. Can't figure it out. I use FileResult response type: File bytes, System.
Octet, fileName ; — Jurijs Kastanovs. Clarification: if open the URL through address bar - file is correctly opened. Show 1 more comment. ParPar ParPar 6, 7 7 gold badges 42 42 silver badges 53 53 bronze badges. This works for me perfectly at the time of this comment and newest Chrome — Loredra L.
Get the next one delivered right to your inbox. Check your inbox or spam folder and click the link to confirm your subscription. Kevin I make stuff. Mostly functional, occasionally shiny, stuff. Related Articles.
Add Comments. Thank you for the feedback. The comment is now awaiting moderation. You will be notified via email when the author replies to your comment. Please select a comment to reply. You can add your comment about this article using the form below. Make sure you provide a valid email address else you won't be notified when the author replies to your comment Please note that all comments are moderated and will be deleted if they are Not relavant to the article Spam Advertising campaigns or links to other sites Abusive content.
0コメント