I am running into an issue where I am re-directing a .pdf extension url using IIS 7.5. Here is what is weird happening: When my URL does not contains .pdf
in it like: http://mySite/documents/forms/test
the pdf (test.pdf) opens up perfectly. However, when I am opening through like this: http://mySite/documents/forms/test.pdf
it is showing me
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
I browse through couple of links like: http://chentiangemalc.wordpress.com/2012/02/16/case-of-the-disappearing-pdf/
and
http://support.microsoft.com/kb/979543
But dont know whether they are appropriate. Also tried debugging through fiddler as this link mentioned: http://chentiangemalc.wordpress.com/2012/02/16/case-of-the-disappearing-pdf/
When I am saving the Response Body the pdf file does not get saved in correct format. So I am guessing there is some kind of file corruption? Maybe? But my file opens up perfectly when I do not include the .pdf in the URL. Dont know what is going on :\
I got the answer. I have to change the web.config file to allow .pdf file to open in the browser: