Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 479
  • Last Modified:

PDF irrecognizable code

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
hanjgr
Asked:
hanjgr
  • 9
  • 7
3 Solutions
 
hanjgrAuthor Commented:
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
 
Karl Heinz KremerCommented:
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
 
hanjgrAuthor Commented:
I can display pdf file from other web sites through firefox.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
hanjgrAuthor Commented:
How to make sure the the correct MIME code for PDF files are sent correctly?
what do you mean by "application/pdf"?
0
 
Karl Heinz KremerCommented:
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
 
hanjgrAuthor Commented:
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
 
Karl Heinz KremerCommented:
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
 
hanjgrAuthor Commented:
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
 
Karl Heinz KremerCommented:
That's a question you need to ask to somebody who knows IIS, unfortunately that's not my area of expertise.
0
 
hanjgrAuthor Commented:
I downloaded a MIME edit for firefox and added a new type: application/pdf for extension :.pdf. Still not helped.

0
 
Karl Heinz KremerCommented:
It's not the client side - the wrong value gets sent by the server.
0
 
hanjgrAuthor Commented:
I did it on web server and tried to open the website on the web server too.

0
 
Karl Heinz KremerCommented:
You may want to crosspost this question to a IIS related group.
0
 
hanjgrAuthor Commented:
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
 
Karl Heinz KremerCommented:
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
 
hanjgrAuthor Commented:
Yes,
Thank khkremer very much for helping me figure out where is the problem.
You earned the credit!
0
 
South ModModeratorCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 9
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now