Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PDF's converted to .ashx in sitecore failing to open using IE

As with all media files in Sitecore the extension is converted to .ashx which is proving to be a problem for the visitors to my site when using IE and acrobat reader. Basically the user clicks the download link, the current page loads indicating that something is about to happen but then nothing opens. Would I be correct in saying that Adobe Acrobat is having trouble with the .ashx extension when it is looking for .pdf so it just gives up? If this is the case then how can I get around it?

Kyle

like image 994
styler Avatar asked Jan 21 '23 03:01

styler


2 Answers

I believe this may be a common problem. What version of Sitecore are you using? There are various discussions of this on the SDN:

  • How to Avoid MIME Type Related Download Problems in v5.3
  • Forum post 1
  • Forum post 2

I would check you MIME types as mentioned in the first link above.

like image 124
Mark Ursino Avatar answered Jan 30 '23 13:01

Mark Ursino


Just a side note:

Firefox for Mac has a general problem handling .ashx files directly (ie linking to them directly).

This is usually something that is seen with PDFs, as that will try to open the .ashx file og not check the content disposition.

Be aware of problems with Firefox on a Mac, as PDFs wont seem to work there.

For that you need to setup some stuff according to:

http://sdn.sitecore.net/scrapbook/media%20files%20downloaded%20with%20ashx%20extension.aspx

if you can't access that is basically tells you to go to the web.config, find this:

<mediaType name="PDF file" extensions="pdf">

and change the

<forceDownload>false</forceDownload>

to

<forceDownload>true</forceDownload>
like image 44
Holger Avatar answered Jan 30 '23 14:01

Holger