MozillaZine

ASPX files download when trying to view PDF files

Discussion about official Mozilla Firefox builds
Argelius

User avatar
 
Posts: 88
Joined: June 21st, 2005, 5:16 am

Post Posted November 16th, 2010, 8:33 am

I frequent a web site which I view/download pdf documents. I've recently switched over to Firefox (from Chrome) and now have a problem with this site.

In Chrome, when I click on the pdf icon to view/download the pdf, it opened and was viewable in a new tab.

In FF (4.0b7) I get popup asking me what I'd like to do with a .aspx file (save or open with...). I've tried associating the file type with Preview and Firefox, but in both instances, all I get is a small .aspx file downloaded and no pdf.

I've searched through the forums and found other references to this, but couldn't locate a solution.

Any ideas?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b7) Gecko/20100101 Firefox/4.0b7 ID:20101104131842

RobertJ
Moderator

User avatar
 
Posts: 9253
Joined: October 15th, 2003, 7:40 pm
Location: Chicago IL/Oconomowoc WI

Post Posted November 16th, 2010, 1:50 pm

This is likely do to the Content_Type being set incorrectly by the site. How a file is processed by a browser is determined by the Content-Type field in the http Response Header; the file suffix should be ignored when there is a Content-Type field. FF adheres to this rigorously.

NOTE: Some browsers guess at the content based on the file suffix even when a Content-Type is specified. This is a security issue.

If you could provide a link I can take a look.

.
FF 39.0 - FF 40.0b8 - FF42.0a - TB 38.1 - TB 40.0b1 - TB 41.0a - Mac OSX 10.10.4 Quad-Core Intel Xeon 5500
Computers I've used: IBM 7094/UNIVAC 1108/IBM 360/DEC PDP11/DEC VAX-11 780/DEC VAXstation 8000/Sun SPARCstation 2/Mac from 1984 to 2015

Argelius

User avatar
 
Posts: 88
Joined: June 21st, 2005, 5:16 am

Post Posted November 16th, 2010, 4:53 pm

RobertJ -- thanks for your help.
Unfortunately, it's a secure site with patient information in the pdfs (I'm a doctor), so I can't provide the link.
Work case scenario, I continue to use Chrome for this one site, so not a deal breaker. But I'm a gadget-nut, tinkerer, so I see this as a challenge to fix...

Mordwin
 
Posts: 653
Joined: June 8th, 2005, 6:10 am

Post Posted November 17th, 2010, 6:54 am

That's a site issue, normally you'd serve aspx files as HTML as that's the normal output from the server when processing an aspx file, so this would be the default behaviour on the web server. If the aspx file is going to be actually serving something else, it should use the ContentType property of the Response object to set the correct MIME type (application/pdf in this case) to override the default.

This is an issue for the site's admin, so you'd best contact them to see if they can fix it.

RobertJ
Moderator

User avatar
 
Posts: 9253
Joined: October 15th, 2003, 7:40 pm
Location: Chicago IL/Oconomowoc WI

Post Posted November 17th, 2010, 7:06 am

When you try to download a pdf and get the ASPX instead, before you do anything hit command + I on your keyboard. A window should open. Look under the General tab at a list called Meta. Under Content-Type you should see

Type: application/pdf

If instead you see

Type: text/html

The server is mis-configured. Since FF adheres strictly to the Internet Engineering Task Force (IETF) in RFC2616 (Hypertext Transfer Protocol -- HTTP/1.1), Section 7.2.1 Type, which states:

Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource.


In other words, how a file is processed by a browser should be determined by the Content-Type field in the http Response Header; the file suffix should be ignored when there is a Content-Type field.The Content-Type should be application/pdf not text/html

This is often an issue when the folks responsible for the web server often are not aware of all the "rules" and often only check things using IE on Win.

.
FF 39.0 - FF 40.0b8 - FF42.0a - TB 38.1 - TB 40.0b1 - TB 41.0a - Mac OSX 10.10.4 Quad-Core Intel Xeon 5500
Computers I've used: IBM 7094/UNIVAC 1108/IBM 360/DEC PDP11/DEC VAX-11 780/DEC VAXstation 8000/Sun SPARCstation 2/Mac from 1984 to 2015

karenanne
 
Posts: 432
Joined: September 18th, 2004, 5:16 am

Post Posted September 22nd, 2011, 1:37 pm

I am having a similar problem. (Apparently there is no cmd key on Windows keyboards, so I tried start run cmd, and then stared at the command prompt window, baffled.)

Basically my question is, is there some way around this problem so that I can see the page? Both Firefox and IE and Chrome fail on this, although Chrome opens a tab with the text of the file in it.

The site is http://www.sa.dk/ao/SoegeSider/Folketaelling.aspx and I have the following settings 1921, kobstad, hjorring, skagen, and then any selection in gade.

Thanks.

trolly
Moderator

User avatar
 
Posts: 39175
Joined: August 22nd, 2005, 7:25 am

Post Posted September 22nd, 2011, 1:57 pm

These are Java Web applications. You need a working Java install and plugin.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

karenanne
 
Posts: 432
Joined: September 18th, 2004, 5:16 am

Post Posted September 22nd, 2011, 3:41 pm

Thanks, that worked.

Return to Firefox Builds


Who is online

Users browsing this forum: SLK350 and 4 guests