Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to display pdf documents that do not have .pdf extension in internet explorer

Posted on 2008-06-20
13
Medium Priority
?
435 Views
Last Modified: 2013-12-08
I have created a document viewer in ColdFusion to retrieve documents out of our imaging database.  Hyperlinks to the documents are dynamically created and reference an asp.net webservice.  The url to the retrieve the documents looks like the following: http://servername/pathtowebservice/getImg.aspx?documentID=51086fd9-8518-4cc2-a9fd-528b8f9fe4f8, where documentID is a unique identifier to the document without a file extension.  Most documents are .tiff, which we have set to open with Microsoft Office Document Imaging with no issues.  However, internet explorere displays "Internet explorer cannot display this webpage" when trying to access documents of type PDF.  I tried disabling the "display in browser" feature of Adober Reader, and the links will open up in Reader. I am able to right-click the link and "save as", and the file is retrieved and downloaded and as a PDF.  Due to other programs in use, I need the ability to open PDF's in internet explorer and this was not a viable solution.  I have tried configuring PDF MIME types in IIS on both the calling and receiving servers with no success.  I have repaired the Adobe installation and cheked for the existence of the necessary .dll files and add-ons in internet explorer. LInks to other PDF documents on different websites open in Internet Explorer without issue.   Any questions or comments on how I can get the PDF's to display will be greatly appreciated.  
0
Comment
Question by:lbhc
[X]
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
13 Comments
 
LVL 5

Expert Comment

by:virtuatech
ID: 21833807
Does opening a PDF in IE work at any random site?  Try this:
http://vmware.com/files/pdf/ThinAppFAQ.pdf
0
 
LVL 11

Expert Comment

by:asafadis
ID: 21833828
Look into setting the MIME type in the actual page, not the IIS server.
I'm no ASP expert, so I really can't provide any examples... but the concept remains.
0
 
LVL 1

Author Comment

by:lbhc
ID: 21833873
virtuatech,
as mentioned in my question I have no problem accessing PDF's from other websites or other applications I have written.  The problem seems to solely rest on retrieving the PDF's from the webservice, or more precisely a link to a pdf that does not contain the .pdf extension.
0
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
LVL 1

Author Comment

by:lbhc
ID: 21833903
asafadis:
thank you for your reply, but the document does indeed have it's MIME type set before it is saved in the database.  WIthout that eventuality, I do not believe that I could right-click the link and have it saved automatically as a PDF, which is the behavior that is currently produced.  
0
 
LVL 5

Expert Comment

by:virtuatech
ID: 21834086
It has to be something in the programming of your webservice.  There is no problem with IE if you are able to do it on other sites.  Do the TIF files behave the same way, I mean like when you do a save as, they do not have the .TIF extension?
0
 
LVL 1

Author Comment

by:lbhc
ID: 21834167
virtuatech:
Each call to the webservice is made with the documentID, which does not include an extension.  This goes for .TIF files as well as HTML and JPG files.  In every case, the file will open with the appropriate application. TIF with Document Imaging, HTML and JPG within Internet Explorer.  It is only the PDF files that will not open.  If I right click the PDF link and do a Save As, I get a dialog box that says "getting file information" from getImg.aspx (the webservice function), a few seconds later a save dialog box will open with getImg.pdf (including the extension) filled in for the file name and saves appropriately as a pdf.  The pdf seems to be recognized as such with this explicit download instruction, just not by clicking the link directly.  
0
 
LVL 5

Expert Comment

by:virtuatech
ID: 21834213
What is the URL shown in the address bar when the PDF link is left-clicked, after the "Internet Explorer cannot display this webpage"?
0
 
LVL 1

Author Comment

by:lbhc
ID: 21834285
0
 
LVL 5

Expert Comment

by:virtuatech
ID: 21834556
Have you tried it with Firefox? or IE7?  Or maybe updating Acrobat viewer...
0
 
LVL 1

Author Comment

by:lbhc
ID: 21834870
virtuatech:
I am currently using IE7 and have the latest version, and no other version of Reader installed.  Using Firefox yields interesting results.  Clicking on the link in Firefox yields a Open With / Save to disk dialog where I can choose to open the link with Acrobat Reader (executable AcroRd32.exe), which opens the file properly.  It is due to this behavior, and the fact that I can disable PDF's from opening in internet explorer through the preferences in Adobe Reader and the link opens just fine in Reader, that I believe the problem rests in the the Acrobat plugins for IE, or how IE is configured to access pdf's and / or files without extensions.  Using firefox however is not an option for my company and therefor is unfortunately not a solution to this particular problem.  
0
 
LVL 5

Expert Comment

by:virtuatech
ID: 21834893
Is your Reader version up-to-date?  Try reinstalling it.
0
 
LVL 5

Expert Comment

by:virtuatech
ID: 21834900
Check the settings in Internet Options -> Programs -> Manage Addons...
0
 
LVL 7

Accepted Solution

by:
Dauhee earned 2000 total points
ID: 21837607
with asp.net could you write it out to the browser with something like:

                Response.Clear()
                Response.ContentType = "Application/pdf"
                Response.AddHeader("Content-Disposition", "inline; filename=" & IO.Path.GetFileName(strFileName).Replace(" ", "_"))
                Response.WriteFile(strFileName)
                Response.Flush()
                Response.End()


this way the browser is told what application to use and won't be concerned with the file extention
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

705 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