Atozed Forums

Full Version: Warning about PDF resource
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
When I use the next code with ModalWindow to download a pdf I am getting the next message in chrome console.
The PDF is downloaded but I get the warning.
Is there a way to avoid it?

Code:
IWBase__ED463BD0B.js:4 Resource interpreted as Document but transferred with MIME type application/pdf



Code:
with IWModalWindow1 do begin
    Reset;
    Autosize := False;
    Title := 'Bulário';
    Draggable := False;
    WindowWidth := 95;
    WindowHeight := 95;
    Src := 'http://mysite/document.pdf';
    OnAsyncClick := nil;
    Show;
  end;

Regards, Luiz
I can't recreate this. 

Please ignore. I could recreate it here. I'll investigate why it happens on Chrome and let you know... 

Kind regards
Hi,

after some investigation I'm positive that this is a Chrome bug (or at least an unexpected behavior).

There is nothing wrong with the call or the headers. All other browsers work just fine too.

But more precisely, you can find this thread here, on Chromium bug tracking:

https://bugs.chromium.org/p/chromium/iss...il?id=9891

This is a 10 year old issue which is still open. There are reports from 2009 up to 2018, from people using PHP, ASP.NET, Python, you name it. If you google for "interpreted as Document but transferred with MIME type" you will get around 3K hits. Most developers just ignore it once Chrome devs decided to ignore it as well.

So, in short: there is nothing we can do to avoid this.
Running quickly through the info in the link, it appears it depends on what's in the PDF? And/or is intermittent.

If so, having control of the PDF might offer a solution for some folks.

I can confirm that the PDF's I have show correctly in Chrome as a modal window. At least on this machine.

Dan
(05-09-2019, 10:38 AM)Alexandre Machado Wrote: [ -> ]Hi,

after some investigation I'm positive that this is a Chrome bug (or at least an unexpected behavior).

There is nothing wrong with the call or the headers. All other browsers work just fine too.

But more precisely, you can find this thread here, on Chromium bug tracking:

https://bugs.chromium.org/p/chromium/iss...il?id=9891

This is a 10 year old issue which is still open. There are reports from 2009 up to 2018, from people using PHP, ASP.NET, Python, you name it. If you google for "interpreted as Document but transferred with MIME type" you will get around 3K hits. Most developers just ignore it once Chrome devs decided to ignore it as well.

So, in short: there is nothing we can do to avoid this.

Ok. I was thinking i was making something wrong. Thank you Alexandre