DNNCommunity / DNN.Repository

DNN.Repository is a rich module used for managing and displaying rich collections of images, files, llinks, etc. on your DNN site. Includes user rating, comments, templating and skinning.
MIT License
8 stars 14 forks source link

repository 4.1 - PDFs files corrupt #45

Closed barnsley7 closed 4 years ago

barnsley7 commented 4 years ago

We have just upgraded our repository module from 4.0 to 4.1 (and upgraded DNN too) and most of our PDF documents failed to open.

we got an Adobe error saying: "There was an error opening this document. The file is damaged and could not be repaired"

Some PDFs did open (after a repair) but most did not.

We are on DNN 9.6.1 ( we have recently done several upgrades from 7.4.2 but have been checking all modules along the way and the Repository did appear to work in other DNN versions but that was probably only version 4.0 of the repository which fully worked.

Software Versions

To Reproduce

Steps to reproduce the behavior:

  1. Go to version 9.6.1
  2. upgrade repository 4.1
  3. download a few PDFs
  4. See error - There was an error opening this document. The file is damaged and could not be repaired"

Expected behavior

Adobe may try to repair the file before opening

juvander commented 4 years ago

What happens if you upload a new pdf and open that? How about other files, for example plain .txt and .docx?

barnsley7 commented 4 years ago

other files were fine. we have since reverted back to version 4.0 sorry, i don't know what was happening with new files though.

juvander commented 4 years ago

Check that on the server you are able to download pdf file correctly and that the file extension is configured correctly on the IIS side. Otherwise it might download it in wrong format. I think there was some change on where it gets the extension information it pushes through and it uses the config instead of hard coded ones.

juvander commented 4 years ago

This one: https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap

barnsley7 commented 4 years ago

thanks, we'll have to try that if/when we attempt another upgrade.

barnsley7 commented 4 years ago

btw, we have another DNN site, which uses the same IIS server (albeit DNN 5.4.4 and repository version 3.1.15) and that has always been ok, no problems with opening PDFs. And since taking the above site back to repository version 4.0 there are no problems downloading PDF files. I believe if the PDFs which tried to open in Adobe in 4.1 were failing, but if they opened in the browser - they were ok.

juvander commented 4 years ago

I would also try to clean browser cache before downloading them again