We have an issue where all images from the media library display fine. But PDFs stored in the media library download with 0 bytes.

We've tracked this down to an issue somewhere in the Multisites configuration as with a single site the PDF downloads without any issues. However with multiples sites configured it fails to find the PDF in the media cache and returns a zero byte file.

Is this a bug or do we need to configure something to resolve this?

  • The URLs to your PDF files - are they fully qualified? With host/domain information etc?
    – Mark Cassidy
    Oct 3 '16 at 21:37
  • They were but we updated them to be relative a while back as the urls changed when they were moved around. Is this needed in order to resolve to the correct site (pick up the context) ? Oct 3 '16 at 21:42
  • Yes, in a multi-site setup it is. At least I believe it is. I think I've seen a bug related to this in some earlier versions of Sitecore 8.
    – Mark Cassidy
    Oct 3 '16 at 21:47
  • If your config for PDF set to forceDownload of PDF files? It could be related to Chunked Transfer Encoding: jammykam.wordpress.com/2014/07/30/…
    – jammykam
    Oct 3 '16 at 21:57

So we got to the bottom of this. It was due to a custom media file pipeline in the end. What was confusing was that it was hard to track down/replicate due to the media cache getting in the way.

In the end we needed to add some code to check the file types and skip our pipeline to get it to work.

All the above comments were really useful in order to figure this out though so thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.