Forum

Thread tagged as: Question, Problem

Cannot upload PDF in Perch 3

Hi,

Just upgraded a site from Perch 2 to Perch 3.

This may be unrelated to the upgrade, but we cannot upload PDFs. This happens within a region or trying to upload to assets.

A PDf file can be selected, but once the form is submitted the file section just reverts back to blank. selecting and submitting images is no problem.

We've chosen very small PDFs (just a few kb) and the limit is 25mb, so I cannot see any problems there.

UPDATE: On my debug info I get this:

Array
(
    [0] => Mime type did not match: application/pdf; charset=binary

    [1] => Failed file type check
)

This is my diagnostic:

Perch: 3.0.10, PHP: 5.4.45, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.0.10), assets (3.0.10), categories (3.0.10), perch_events (1.9.5), perch_members (1.6.1)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_events', 'perch_members', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/hbma/public_html/perch
PERCH_CORE: /home/hbma/public_html/perch/core
PERCH_RESFILEPATH: /home/hbma/public_html/perch/resources
Image manipulation: GD
PHP limits: Max upload 25M, Max POST 128M, Memory: 256M, Total max file upload: 25M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
DOCUMENT_ROOT: /home/hbma/public_html
HTTP_HOST: www.hbma-gpfederation.co.uk
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Does anyone know what might be the issue?

Alex Bennett

Alex Bennett 0 points

  • 3 years ago

Just saw another post that gave a clue to the issue, and sure enough it had PERCH_PARANOID enabled in the config file. After setting that back to false uploading PDFs worked fine. I took this site over from someone else, so I'm not sure how important the PERCH_PARANOID is, so if so does anyone know how to make sure you can still upload PDFs with this enabled?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you have the finfo PHP extension installed? If not, give it a try.