The believing brain michael shermer
I could not find anywhere just an explanation of the message by itself. Here is my interpretation. As far as I understand, Chrome was expecting some material it could possibly display a document , but it obtained something it could not display or something it was told not to display.
This is both a question of how the document was declared at the HTML page level in href see the download attribute in Roy's message and how it is declared within the server's answer by the means of HTTP headers in particular Content-Disposition. This is a question of contract , as opposed to hope and expectation. Actually, the attachment disposition just means this: the browser shall not interpret the link, but rather store it somewhere for other—hidden—purposes.
Here above, either download is missing beside href , or Content-disposition must be removed from the headers. It depends on whether we want the browser to render the document or not. I encountered this same issue today with Chrome Version The headers are correct, express sets them properly automatically, it works in other browsers as indicated, putting html 5 'download' attribute does not resolve, what did resolve it is going into the chrome advanced settings and checking the box "Ask where to save each file before downloading".
It seems that iframe interprets it as a document but it is not. That's why it displays a warning. With this, chrome opens a new tab and loads the PDF without warning even in responsive mode. I had this issue in an ASP web site project. Adding a "Content-Length" header caused downloads to start working again in Chrome. I have updated my Chrome to latest 62 version and it started to showing the PDF again. But the message is still there in the console.
Just ran into this and none of the other information I could find helped: it was a stupid error: I was sending output to the browser before starting the file download.
Surprisingly, I found no helpful errors found like "headers already sent" etc. Hopefully, this saves someone else some grief! In my case the file name was too long, and got the same error. Once shortened below chars worked fine. I got this error because I was serving from my file system. Once I started with a http server chrome could figure it out.
I was experiencing the same trouble with a download manager I created. The problem I was having involved the file name being too long and the extension being clipped off. Solution: Increased the MySQL database field to to store the file name, and performed a length check before saving the blob.
I've faced this today, and my issue was that my Content-Disposition tag was wrongly set. Learn more. Asked 8 years, 11 months ago. Active 2 months ago. Viewed k times. With Chrome Uwe Keim Ashley Williams Ashley Williams 6, 4 4 gold badges 29 29 silver badges 39 39 bronze badges. Active Oldest Votes. That fixes Chrome, but breaks other browsers. My Android phones won't download from that kind of link. And it's , so don't expect it to anytime soon either.
Saeed Neamati Saeed Neamati It's probably also worth pointing out that the zip URL is dynamic in my app, so it's nothing to do with caching. I'm absolutely stumped here, I really am!
What are you talking about? There is no request header in the question. Both of them are response headers. And I am sitting here wondering why this should be an answer but not a comment?
Evan Evan 1, 13 13 silver badges 20 20 bronze badges. Not sure what you are using for that, so it's hard to give more info. What language or framework are you using for your server?
I've fixed this…by simply opening a new tab. What do you mean you "opened a new tab"??? You manually opened a new browser window and pasted the download URL in there?
Yes, exactly. I assumed it was a bug in the application-state of the particular tab. I wouldn't expect the user to open a new tab And I don't find opening one to download a file elegant either.
Joram et. Sweeping under the rug is not s solution. This clearly does not solve the original answer. What would I put in the user doc "copy the url, open a new tab, paste the url, Business down. Hope this helps. Champignac Champignac 4 4 silver badges 5 5 bronze badges. JohnC JohnC 2, 4 4 gold badges 32 32 silver badges 42 42 bronze badges. Elliveny Elliveny 1, 1 1 gold badge 16 16 silver badges 23 23 bronze badges.
Carmela Carmela 6 6 silver badges 13 13 bronze badges. AS Mackay 2, 9 9 gold badges 13 13 silver badges 22 22 bronze badges. I did this and it worked: window. Salisbury R. Salisbury 1, 11 11 silver badges 15 15 bronze badges. This issue was re-appeared at Chrome 61 version. But it seems it is fixed at Chrome Asif Nowaj Asif Nowaj 4 4 bronze badges. Try below code and I hope this will work for you. DefaultPrint ; break; case "PDF": this.
Faraz Faraz 3 3 silver badges 12 12 bronze badges. So to set your header, Java code would look like this Olivier B. Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. The Overflow The next right thing. Navigation or forgetfulness? On finding purple links in your search. Featured on Meta. We're switching to CommonMark. New post lock available on meta sites: Policy Lock.