I'm trying to link a pdf document from a static html file.
What I'm using is:
My pdf File
the open/save dialog comes up in firefox but not in IE7 or IE8.
I believe I have to change the MIME type but I don't know where to change it...
Since it works in Firefox I assume the file is actually there and accessible. In that case it depends on the browser settings how the download is handled. It might be that the download happens in the background because you setup that it should automatically download everything into a predefined folder (e.g. My Downloads/).
Check the IE settings to see where it puts downloads and check the folder to see if downloaded the file.
Related
I have an hyperlink to a pdf form that can not be opened by the browser's pdf viewer. If clicked, the browser tries to show it but I get the error message like "it is necessary Acrobat Reader 8.x" etc. Is there a way to force an hyperlink to such pdf form file to only allow its downloading? In this way, the user could open it with his local Adobe Reader.
Let’s say you have a PDF that you want to let people download. The file will be like this:
Download Receipt
In most browsers, clicking on the link will open the file directly in the browser.
But, if you add the download attribute to the link, it will tell the browser to download the file instead.
<a href="/path/to/your/receipt.pdf" download>Download Receipt</a>
The download attribute works in all modern browsers, including MS Edge, but not Internet Explorer.
In the latest versions of Chrome, you cannot download cross-origin files (they have to be hosted on the same domain).
To make the hyperlink to download the pdf file when clicked, you should use download property inside the anchor tag. For example you can see the code below:
Download the pdf file
You can also give your own name to the downloadable pdf file in the download property that I provided as 'Document' in the code above.
Yes, it is possible. First download the file and then you'll see a link when it downloaded(it disappears quite quickly) just copy it and use:
hyperlink
When using the Microsoft Edge browser, by default when you open a PDF it will open the PDF in a new tab using the built-in PDF viewer. To avoid this, you can adjust the browser's settings: Toggle on the "Always open PDF files externally" option. This works great. However, it presents a separate issue. Our internal applications use embedded PDFs in iframes. When the external toggle is set to on, these PDFs will not show in the iframes. This doesn't happen in Chrome. Has anyone else experienced this and know a work around?
I've tried removing the type="application/pdf" from the iframe tag to no avail. I can't find anything else online.
It looks like an expected result because you have enabled the option Always open PDF files externally.
So MS Edge browser is giving you an option to download the PDF file and open it using the desired app.
You said this doesn't happen in Chrome browser.
If you enabled the Download PDF files instead of automatically opening them in Chrome option then you will notice the same result in the Chrome browser.
Output in the Chrome browser:
If you click on the Open button then it will download the PDF file.
I did not get any solution or a workaround for this issue.
If you think that there should be an option to load the file in an iframe if Always open PDF files externally option is enabled then I suggest you click on the Send Feedback button in the MS Edge browser and try to provide your feedback about it to the Microsoft.
I posted feedback suggesting that an exclusion/inclusion list be in included but the simplest way would be to treat the frame as part of the session. But this is not Microsoft it is the Chrome projects issue.
I want to just be able to get people to go a link to an mhtml file hosted on a server and be able to see the fully formatted webpage that you'll see when you save the file and open it in Google Chrome (Apparently IE works as well, Firefox and Microsoft Edge do not work). How do I go about doing that?
Might as well post this as an answer for whomever else gets this problem.
Upon renaming the mhtml file to an mht file, and Extractmht can be used to convert the file to an html file, which can then be hosted.
[2022 Edit]:
Alternatively, open the mhtml file in Chrome/Firefox and use an extension like Singlefile to download it as a proper html page.
I know I can edit HTML elements in Chrome / Firefox inspector. But how can I save changes to the local file on my desktop?
Chrome is able to do some stuff via workspaces. Open devtools go to Sources add folder to workspace pick your index.html (or whatever) edit and save by clicking ctrl+s. Refresh browser and you'll see that changes are permanent. You can't however go to Elements/Inspector pick some tag change it and save because "DOM!==HTML".
Yes you can edit a locally saved html file in IE9 by right clicking the page in the browser window, choosing "view source" which opens in notepad and editing the code and then go to file and save the changes.
You can do the same thing In Firefox by opening Firebug and then opening the Firebug editor which is notepad.
I just thought I remembered doing it by just right clicking the page and opening "view source" in Firefox just as I did in IE9.
View Source in Firefox allows you to play around with your code and edit it but to save and edit the actual working file requires opening it up, making those same changes, then saving. I'd suggest using the developer tools and once you have what you want, copying and pasting the altered source code to use in the original file. If you have firebug and the firebug editor I think you may then be able to actually update the file itself. Chrome allows you to edit JavaScript like that but I'm not sure about HTML and CSS
I have the same problem, how to edit the DOM html and save the results. On my PC I can effectively do this operation using Scratchpad by changing the file type to all, open the file, edit it, do a save, then refresh the page. With a bit of messing around you can copy and paste from the Inspector to the Scratchpad. It's pretty hacky, but it does work.
However, one of my students who is using a Macbook AIR can't edit html files with ScratchPad, she can edit .js files, but all the html files are grayed out and can't be clicked. Bottom line is I don't know if this "solution" works for all systems.
i have a .zip file sitting on an IIS 6 webserver.
i have an html file with a link to that zip file like this:
Download File
When you open the page and click the link in firefox or chrome, you get the Open or Save dialog box as expected.
When you do the same in Internet Explorer 8, you navigate to a new page that displays the "contents" of the zip file as text (unreadable characters). This happens on at least 3 machines that were tested.
Any idea why this would be happening in IE or what i need to do to fix it?
Changing IE settings is not an option since we do not control the settings of who goes to our site. Changing the HTML or javascript on the page with link is an option.
Thanks for the help!
You may need to set the MIME type of the file. To do so, go to IIS6 Manager for the website. Go to Properties for the site (right-click on the website name for Properties in the menu). Click the HTTP Headers tab. Click the MIME Types... button.
From there, you should be able to add .zip as an extension. I'm not entirely sure which MIME type will work best, but application/zip and application/x-zip are two options to try.