Solved

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

Posted on 2008-06-20
13
429 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
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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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 500 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

806 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