Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2008-06-20
13
Medium Priority
?
441 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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Several part series to implement Internet Explorer 11 Enterprise Mode
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

885 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