Solved

Http Handler not working to retireve .pdf documents from a virtual directory

Posted on 2008-10-17
2
598 Views
Last Modified: 2013-11-22
I've created a website in asp.net, framework 2.0 using VS2005.  I've got an .aspx page with hyperlinks that map down to a virutal directory on the website to show .pdf documents when a user clicks on the links.  When I create the link to the .pdf files, I swap out part of the path with a session id so that no one can grap that URL and email it to someone else.  When a user clicks on the link my HTTP Handler swaps out the session id with the correct path to the file.  This all works on my development machine but when I deploy it to a server I get the Http error 404.  I believe my http handler is not firing on the test machine.   On the virutal server properties I configured a windows account to connect  as that account.  I left anonymous checked with the default account, IUSR.  Is there something that I'm missing?  Sorry for the long explanation, and if this has already been posted.  This has to be a configuration setting I'm missing or that the http hander is not registered correctly.  

Here is my http handler on my config file,
<add verb="GET" path="*.pdf" type="Glidewell.Handler.ResourceHandler, Glidewell.Handler"/>.

Thanks.
0
Comment
Question by:GLlano
2 Comments
 
LVL 13

Expert Comment

by:crazyman
ID: 22742938
0
 

Accepted Solution

by:
GLlano earned 0 total points
ID: 22798853
I found the solution.  The issue was that the website tries first to check if the file exists before it tries to excute the hander for the pdf file.  You need to perform the following steps to take this off from
checking.
1.) Go into IIS
2.) Right mouse click on your website, go to properties.
3.) Go to the Home directory tab.
4.) Click on the Configuration button.
5.) Look for the .pdf file extension and click on the Edit button.
6.) Uncheck the  Check if file exists checkbox button.
7.) Click on Ok to exit the screens.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now