Jump to content

Issues with PDF files.


Philipp
 Share

Recommended Posts

I've run into this issue again: When uploading a PDF file, the upload stops at 100% and no file is saved. This is problably not a problem with the server configuration: I've checked the php.ini settings and I can easily upload some other PDFS or large iamages without any problems. It only occures with some PDF files.

  • Some PDFs work, some don't. I've attached an example.
  • The PDFs were created on Mac OS X (using Adobe software). 
  • Saving the files again with the preview.app on OS X helped once. 
  • Tried uploading them from another computer / OS - without success.
  • I can upload larger files, other file types or other PDFs to the installation without problems.
  • Two users had those problems.

Just using a standard file field.  

Can someone maybe try to upload the PDF? If it's possible, it might be the server configuration. If not, I'm note sure where to look for a solution. Might be a wrong structure of the saved pdf. There is nothing special in the ERROR Log or in the debug view.

Thanks for help.

(Removed the attachment)

Link to comment
Share on other sites

That PDF uploads fine for me. I can't imagine why you could upload files of different types and larger PDFs and have some not work, but I am sure you are just as baffled by that :)

What about the Site Indexer module? - I wonder if that might be the issue since it scans the PDF - can't remember whether it does it on upload or page save though.

I wonder if somehow there is an issue with the reporting of the size of these files.

Have you tried disabling the HTML5 uploader and seeing if these PDFs will work then? Might help to narrow down the problem to server vs PW

Link to comment
Share on other sites

ProcessWire doesn't know anything about PDF files. And the file size is not large, so I think we can rule out a max_upload_size issue. If something is interfering with the upload, it would have to be lower level in the server (Apache mod_security maybe doesn't like the filename or something in the PDF file?)

  • Like 2
Link to comment
Share on other sites

  • 2 months later...

Sorry for pushing this old post. Been quiet some time but have to report back with some research. Not solutions but some useful intel for other people having the same problems as me.

  • Using a normal ProcessWire 2.3 download and installing it without any 3rd party modules produces the problems too.
  • I've looked through the php.ini, all configs and every switch I could find. Found nothing that could possible cause the problems. Limits are way over the file sizes.
  • File name, file content etc. isn't a problem. Tried several combinations.
  • This problems especially occurs with PDF files and images. 
  • It's a problem with our server, not ProcessWire :P

I've found one problem with JPG files saved in Adobe Photoshop:

  • Open a 16bit JPG/TIFF file (e.g. from Lightroom)
  • Saving it as a JPG with "Save as..." will cause the upload to fail. Stuck at 100%.
  • Converting the image to 8bit in Photoshop by changing the image modus helps. Save it again and the upload works.
  • Reproducable

No idea why it happens, but this fixes some images. I've started to look closer to the PDF files and tried the same thing here:

  • PDFs are saved with Adobe Illustrator CC via "Save copy as..."
  • Saving a PDF with either 8bit or 16bit JPG included doesn't make a difference. Uploads fails with the default Adobe settings.
  • Removing all meta data (previews, editable paths) doesn't help
  • Changing the PDF version from 1.3 to 1.5 doesn't help.
  • Specify a output color profile doesn't help
  • But: Removing all meta data AND specify a color profile makes the upload work. Didn't get stuck with 100%. PDF 1.3 to PDF 1.5

That's all I could figure out. If you have another idea let me know.  Thanks.

  • Like 2
Link to comment
Share on other sites

Running PHP Version 5.3.27, memory limit set to 64M and max_execution to 60 seconds. Trying it with 128MB now.

Looking through the logs, I've found some suspicious entries. Time it little bit off: 

[Thu Jan 16 20:12:50 2014] [error] [client 87.165.***.***] mod_security: Access denied with code 406. Pattern match "cc:" at POST_PAYLOAD [severity "EMERGENCY"] [hostname "redacted.com"] [uri "/processwire/page/edit/?id=22354"] 

If this is the issue, Ryan was right. Thanks. Looking into mod_security now. 

EDIT: Solved! Google spit out some interessting links for "POST_PAYLOAD" and mod_security. I've deactivated the POST filtering for mod_security. Just add this to your .htaccess file:
 

<IfModule mod_security.c>
    # Should mod_security inspect POST payloads
    SecFilterScanPOST Off
</IfModule>

Taken from this site (more info)

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...