Skip to content

Solved: Chrome downloading file instead of displaying page

by Finn Espen Gundersen on June 17th, 2013

A lot of developers are experiencing the same problem: while all other browsers display your latest web creation perfectly, Chrome just downloads the script source file – yes, source.

Several support threads describe the same problem, suggesting everything from security flaws and misconfigured servers to a chrome bug.

chrome_download

The answer is simple: you visited your unfinished site in Chrome before it was configured correctly. Chrome correctly just downloaded your front page script file – and it has cached that result, showing it to you again and again.

A simple curl invocation will confirm this, just goes to show how useful simple command-line tools can be.

Finally..solved!

Finally..solved!

The solution, with the cause now found, is equally simple: menu, settings, scroll to bottom, click advanced, click clear browsing data and select how long a time you have been frustrated: last day usually does it for me. And then click Clear browsing data.
At least Chrome has the choice of time period, to avoid having to erase the entire cache. That would both have taken some serious disk activity as well as slowed down browsing for a few days.

From → FreeBSD, Windows

25 Comments
  1. HTML etc. pages display nicely in chrome, but when I address a doc file in the web all I’m offered by chrome is a download, not an open with wird right away. Firefox is fine, however (about:preferences, settings, applications). Chrome, extensions, chrome apps, Docs won’t do. Fritz Jörn

  2. jin permalink

    thank you ! suffer for a week from this, helped me a lot!

  3. Mr. Worf permalink

    Thanks for sharing this information. It worked perfectly. No problems at all !!!

  4. Yeah, but if that happens for other users? How will they know to just go clear the Browsing Data? It works for the owner of the site but doesn’t work for the other users right?

  5. Please why download the page link when you click on it instead of displaying the note and you experience this problem in all chrome browsers
    And fayrfox and Microsoft edge
    At the same time on an Android mobile phone

    • yes I am also facing the same issue in every browser and it is only occurring with my site. Don’t know how to fix it.

  6. On Windows, this opens the file in Notepad. Would like to know how to read any.log from Chrome directly (as seen for any.txt files) Thyag Oct 6 ’17 at 15:27

  7. Thanks, it solved my problem

  8. This gave a whole lot of headache. Fixed

  9. Victor Ruiz permalink

    Doesn’t work for me. Had to use Internet Explorer in order to download what I needed.

  10. Naren Dhyani permalink

    It started to happen to me as well, tried clearing my browser history. Still no luck, can someone help me understand why?

  11. Thanks for the solution mate.

  12. Goshiana permalink

    Hi I’m facing the same problem as above
    Cleared cache and cookies for all time
    Yet not working
    Please help. I need to my site to work.

  13. Udayan Sikdar permalink

    Thank You so much. This issue was really annoying.

  14. Sebastian Soldan permalink

    Man you saved my day!!! Thanks a Lot! 🙂

  15. thank you ! suffer for a week from this, helped me a lot!

  16. Human 2.0 permalink

    Thanks!!

  17. Hi All,

    Problem – File gets download when trying to access the webapplication.

    Even i have the same problem, In my case http requests are giving problem and https no issues , I using nginx reverse proxy..If someone can help here
    Thanks

  18. Thanks for sharing such useful information with us. I’m really glad to keep posting that.

  19. Thanks you saved me, I wasted this two days for this solution. Finally got

  20. thanks. My problem is solved now.

  21. Thank you!

  22. I am facing this problem repeatedly,
    1.clear browser
    2.delete .htaccess file
    3.change the version of php

    This problem I have facing many times, my question is that why this problem?

  23. Amira permalink

    u r the best..thaaaaaank you!!

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS