Why do my pdf in chrome download as html






















Thats Great Its Working. Thanks a lot. Can we specify the path where the file is to be downloaded?? EhsaanIsrar we cannot. Browsers normally use the user settings for downloaded files. EhsaanIsrar you can mark the answer as accepted though, can you not? I'm not sure what do you mean by 'automatically in xhtml'.

The question was about javascript which should work just fine. You can add a script tag at the end of the body etc — minj. Show 3 more comments. It is also possible to open the pdf link in a new window and let the browser handle the rest: window. Andreas Andreas 9 9 silver badges 22 22 bronze badges. URL window. Suresh Suthar Suresh Suthar 7 7 silver badges 14 14 bronze badges.

Alpesh Panchal Alpesh Panchal 1, 10 10 silver badges 9 9 bronze badges. Please Elaborate — Ehsaan Israr. Well, full path means if you enter direct url to pdf into browser address bar, you can access it. Show 2 more comments. Sign up or log in Sign up using Google. Sign up using Facebook. Then, go to "Storage" and clear cache and data. After that, go back to the previous screen and tap "Force Stop". It's also recommended to reboot your Android.

If the network condition is not good, you may be unable to view sites as smoothly as you expect. You can thus hook up to another Wi-Fi or reset the network settings to original defaults. Google Chrome app also provides Incognito Mode for users. This mode will stop all potentially harmful programs, so I recommend you to open an incognito window and see whether you can browse sites as usual.

If you've updated Android or iPhone to the latest operating system lately, Chrome app may be having a compatibility problem with the current version. Otherwise, delete Google Chrome from your device and then reinstall it again.

Many say this helps them out. Is the Chrome page unresponsive problem solved? If you're having a better idea, you're welcome to share with us. Thanks for taking your precious time to read this article. At this point the easiest thing to do is just use Firefox. It works as good if not better than Chrome anyway and does not have this problem. FonePaw uses cookies to ensure you get the best experience on our website.

Click Privacy Policy to learn more. Got it! Fix it Here. Why Pages Unresponsive on Google Chrome? Solution 1: Try Incognito Windows Mode If your pages keep unresponsive even after being refreshed several times, you can try the incognito mode for help.

Solution 2: Reset Browser Settings Some mistakes in settings will be the root cause of the unresponsive page problem. Solution 3: Disable Hardware Acceleration Hardware acceleration is originally used to provide you with a smoother browsing experience. Solution 4: Remove Incompatible Adds-on, Plugins, Extensions The unresponsive page problem may due to faulty adds-on, plugins, or extensions.

Solution 2: Reset Network Settings If the network condition is not good, you may be unable to view sites as smoothly as you expect. This may not be appropriate approach for all uses as it requires high level server access to configure. As such, if you have said access it's probably because you already know how to do those two things. If not, check Nick's blog for more instructions. As the html5 way my previous answer is not available in all browsers, heres another slightly hack way. Now set location.

This will cause the browser to download the file. Unfortunately you can't set file name or extension this way. Fiddling with the media-type could yield something. I needed to do this for files created with dynamic names in a particular folder and served by IIS.

If you are using HTML5 and i guess now a days everyone uses that , there is an attribute called download. I've had some issues with the suggested solution that creates an a DOM element, and sets the download attribute. It still displayed a popup warning in some browsers perhaps they got a little stricter by Adding the pdf mime type to the href attribute solved the browser popup warning, but it messed up the file the downloaded file got damaged and couldn't be opened. His code example uses an npm library though.

Here's how to do it using js only:. The behaviour should depend on how the browser is set up to handle various MIME types. I recommend against this as it should be the users choice what will happen when they open a PDF file. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more.

Asked 10 years, 4 months ago. Active 1 month ago. Viewed k times. Improve this question. MikeD 4, 1 1 gold badge 23 23 silver badges 39 39 bronze badges. This is to my knowledge not scriptable behavior. Most browsers will have their own settings for the behavior of what to do with specific file types on download. This question has also been answered here: stackoverflow. Add a comment. Active Oldest Votes. With html5, it is possible now.

Set a "download" attr in element. Improve this answer. Sarim Sarim 2, 2 2 gold badges 17 17 silver badges 20 20 bronze badges. You better go with this solution if it's supported. Here's a way to check if it is if "download" in document. Is there a way one can specify the text for the pdf instead of mentioning file path?



0コメント

  • 1000 / 1000