I want to download a pdf file from the web server using $http
. I use this code which works great, my file only is save as a html file, but when I open it it is
To instruct the browser to download the file instead of showing it in the browser, try the add following headers to the server response:
Content-Disposition:attachment; filename="filename.xxx"
Content-Type:application/octet-stream
Based on the screenshot, it looks like you have set Firefox as the default application to open your PDF documents on that computer. Which it does, using it's embedded viewer.
So it is saving as a PDF, but your open-in application preferences make it appear as Firefox Html Document.
If you change the open-in preference back to Adobe Reader then the Save-As type should display correctly in the browser.
I hope that helps.