Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

PDF irrecognizable code

Posted on 2011-03-16
18
468 Views
Last Modified: 2012-05-11
I am creating a website with links to the pdf file. The webpages and pdf files are stored in one server. The pdf file can be opened through IE browser but not through the firefox browser.      try to open pdf file the page source
0
Comment
Question by:hanjgr
  • 9
  • 7
18 Comments
 

Author Comment

by:hanjgr
ID: 35157137
I have tried several things according to the post #16012445 and other results I googled on line:
1. Installed Foxit Reader
2. Installed Adobe Reader X also Naunce PDF reader and all are up-to-date
3. Ran windows updates and firefox is up-to-date too.

I can open pdf file in Firefox through "File/Open File...." on that server. but when it comes to website address like :http://rims.gvmc-regis.org/supportcenter/help/quickref/01_How_to_Login9X2.pdf ( still on the same server) it gives me "corrupted" things like shown in the pictures.

I really appreciate any help!

0
 
LVL 44

Assisted Solution

by:Karl Heinz Kremer
Karl Heinz Kremer earned 500 total points
ID: 35158372
Make sure that your web server sends the correct MIME code for PDF files (application/pdf). This looks like Firefox does not know what to do with these PDF files.
Can you display PDF files from other web sites correctly in Firefox?
 
0
 

Author Comment

by:hanjgr
ID: 35158599
I can display pdf file from other web sites through firefox.
0
Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

 

Author Comment

by:hanjgr
ID: 35158640
How to make sure the the correct MIME code for PDF files are sent correctly?
what do you mean by "application/pdf"?
0
 
LVL 44

Assisted Solution

by:Karl Heinz Kremer
Karl Heinz Kremer earned 500 total points
ID: 35158675
On the web server, you need to make sure that the server sends the correct mime type (and that is "application/pdf") for PDF files. If you do not control the server, you need to talk to your hosting provider and have them make that change.
Do you know what server you are using?
Are you using server side scripting to send the PDF files? In that case, it's your responsibility to send the correct HTTP header information (e.g. the MIME type).
0
 

Author Comment

by:hanjgr
ID: 35159569
The web server is windows server 2003 32 bit, with MS IIS to manage the website.
I have check the the MIME Type setting from IIS manager-> local Computer->property-> MIME Types....
.pdf  extension is set to be with MIME type: "application/pdf". I also restarted the IIS service. Still firefox cannot show the pdf file.

Would you give some more details about correct HTTP header information of MIME type?

0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 35159677
Are the PDF files stored on the server, and you just link to them, or are you either dynamically creating them, or streaming them via a server side application?

When you e.g. use PHP to generate the PDF file (or to stream it to the client), you need to add something like this to your program:

header('Content-type: application/pdf');

Every system has it's own syntax, so it depends on what you are using.

To debug the header information in Firefox install the Live HTTP Header extension: https://addons.mozilla.org/firefox/3829/
Once that is installed (and Firefox restarted), go to the Tools menu and open up the Live HTTP Headers application, then try to open your PDF document. Look for a line that starts with Content-Type: - what follows is the MIME type.
0
 

Author Comment

by:hanjgr
ID: 35160010
The PDF files are already stored on the server.
I use a link <a href="help/quickref/04_Print_a_Map9x2.pdf"> in a html file to open pdf.

the html file's header includes: Content-Type: image/gif
the corrupted pdf file's header has: Content-Type:text/html

How can I change the MIME type for the pdf file?

Thanks,

0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 35160269
That's a question you need to ask to somebody who knows IIS, unfortunately that's not my area of expertise.
0
 

Author Comment

by:hanjgr
ID: 35160291
I downloaded a MIME edit for firefox and added a new type: application/pdf for extension :.pdf. Still not helped.

0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 35160353
It's not the client side - the wrong value gets sent by the server.
0
 

Author Comment

by:hanjgr
ID: 35164741
I did it on web server and tried to open the website on the web server too.

0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 35164789
You may want to crosspost this question to a IIS related group.
0
 

Accepted Solution

by:
hanjgr earned 0 total points
ID: 35189478
I figured it out!
The website is managed by ServletExec. The MIME type for pdf needs to be added over there. --Set MIME Mapping.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 35194123
The clue was clearly given during the discussion here: The MIME type for PDF files was set incorrectly on the server. You were only able to "figure it out" after the information I provided.
0
 

Author Comment

by:hanjgr
ID: 35197987
Yes,
Thank khkremer very much for helping me figure out where is the problem.
You earned the credit!
0
 

Expert Comment

by:South Mod
ID: 35230006
All,
 
Following an 'Objection' by khkremer (at http://www.experts-exchange.com/Q_26904677.html) to the intended closure of this question, it has been reviewed by at least one Moderator and is being closed as recommended by the Expert.
 
At this point I am going to re-start the auto-close procedure.
 
Thank you,
 
SouthMod
Community Support Moderator
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a previous article published here at Experts Exchange, Signature Image with Transparent Background (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_12380-Signature-Image-with-Transparent-Background.html), I explained how to cre…
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question