Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Warning about PDF resource
#1
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
Reply
#2
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
Reply
#3
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.
Reply
#4
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
Reply
#5
(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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)