Welcome Guest, Not a member yet? Register   Sign In
Solved: Upload class is destroying PDF content
#1

[eluser]Velin[/eluser]
Hi,

I am having an odd problem with the CI upload class and PDF files.
When I upload PDF files to my local test server (Apache, OS X) and the production server (Apache, Linux), the PDF files become unreadable.

I have searched the forum and other resources, but the problems reported surrounding PDF file uploading all seem to have to do with mimetypes; I don't believe that's the case here.


I have set up a very basic upload page for testing purposes, in which I:
$config['allowed_types'] = 'jpg|jpeg|png|doc|docx|txt|swf|flv|pdf';

I have tried uploading all types of files and they can all be read afterwards just fine.
But for some reason the PDF files cannot. - Depending on what application was used to generate the original PDF file, the content can be more or less read, while in most cases being completely unreadable.

As far as I can tell, the filesize remains the same after upload, and looking at an upload var_dump reveals the correct mimetype: ["file_type"]=> string(15) "application/pdf"

I have tried uploading the same PDF files in both Firefox 3.0.5 and Safari 3.2.1, neither works.


Any thoughts?
#2

[eluser]Velin[/eluser]
After messing around with it for hours, I finally downloaded a fresh copy of the upload class and copied it into my system folder.

Now PDF works fine, like all the other file types did before.

I don't understand how it only broke PDF files, which annoys me quite a bit.

Very strange stuff.




Theme © iAndrew 2016 - Forum software by © MyBB