Forum

Thread tagged as: Problem

Assets not uploading .pdf file

I have a client that has been uploading assets without any issues. Today they are unable to get the asset to upload and show in the assets panel. I tried to upload a pdf document they sent to me and had the same problem. I have tried adding the asset via Asset and CMS logs me out. Could it be a corrupted pdf file? The reason I ask is I converted the file to .doc and it uploaded OK. I recently upgraded the cms to 2.6.6. Ok Update a previous pdf file that did upload will not now. So the issue appears to be with .pdf files only.

Perch is up to date
PHP 5.4.33 is up to date
MySQL 5.0.95 is up to date
Image processing available

Summary information

Perch: 2.6.6, PHP: 5.4.33, MySQL: 5.0.95, with PDO
Server OS: Linux, apache2handler
Installed apps: content (2.6.6), assets (2.6.6), categories (2.6.6)
App runtimes: <?php include(PERCH_PATH.'/core/apps/content/runtime.php'); ?>
Ian Gordon

Ian Gordon 1 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Does the diagnostics just stop there? There should be about a dozen more lines of it.

No there is more just didn't want the paths showing. I just learnt that the files are originally produced in PowerPoint and then converted to .pdf docs. So I am just about to test a file that I know is a 'clean' pdf file. Do you want the of diagnostics

Drew McLellan

Drew McLellan 2638 points
Perch Support

How big is the file? What's the file size limit on your server?

If you don't want to show me information that's fine, but it limits what I can do to help.

Ok So another pdf file didn,t upload and logged me out. File size 168kb

Perch: 2.6.6, PHP: 5.4.33, MySQL: 5.0.95, with PDO
Server OS: Linux, apache2handler
Installed apps: content (2.6.6), assets (2.6.6), categories (2.6.6)
App runtimes: <?php include(PERCH_PATH.'/core/apps/content/runtime.php'); ?>
PERCH_LOGINPATH: /cms
PERCH_PATH: /var/www/vhosts/domain.co.uk/httpsdocs/cms
PERCH_CORE: /var/www/vhosts/domain.co.uk/httpsdocs/cms/core
PERCH_RESFILEPATH: /var/www/vhosts/domain.co.uk/httpsdocs/cms/resources
Image manipulation: GD Imagick
PHP limits: Max upload 16M, Max POST 16M, Memory: 128M, Total max file upload: 16M
Resource folder writeable: Yes
HTTP_HOST: domain.co.uk
DOCUMENT_ROOT: /var/www/vhosts/domain.co.uk/httpsdocs
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
Drew McLellan

Drew McLellan 2638 points
Perch Support

If you got logged out, that suggests a deeper PHP error was thrown.

Have you checked your error log?

No Nothing in the error log apart from: First one was me typo error [Thu Oct 02 12:28:25 2014] [error] [client 82.69.16.141] File does not exist: /var/www/vhosts/domain.co.uk/httpdocs/ms [Thu Oct 02 12:28:36 2014] [error] [client 82.69.16.141] File does not exist: /var/www/vhosts/domain.co.uk/httpdocs/cms [Thu Oct 02 12:28:42 2014] [error] [client 82.69.16.141] File does not exist: /var/www/vhosts/domain.co.uk/httpdocs/cms

Its strange because they have already uploaded a pdf document and tried to upload the same file to a different location and it failed to upload. Yet if you convert pdf's to word doc they upload ok. I am not too sure when I updated to 2.6.6 but it was recently. But I can not be sure if the issue was due to updating.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That looks like an http log. Do PHP errors get logged to the same file?

Drew McLellan said:

That looks like an http log. Do PHP errors get logged to the same file?

Yes, I have spoken to the server folks all seems ok from their point of view. Should I revert back to the previous version and see if I still get the problem? I added htaccess file to show php errors and nothing, still just would not upload pdf file.

So I have cms running on another domain and experienced an issue with .pdf files. When I ran it through Safari I got the following message when trying to up load pdf file "domain/cms/core/apps/assets/edit" server unexpectedly dropped the connection. Other types of file seem to be loading OK the doc file was actually larger than the pdf file? Not quite sure where to go to now. Should I reload the core files incase of an ftp error or should I try an older version? Reloaded the core files in cms still issue with pdf files .doc , xls and jpg all ok

Tried adding an existing pdf from assets and it failed Firefox 'The connection was reset

The connection to the server was reset while the page was loading." Other files are uploading ok

Hi Drew, I have Perch locally for testing and just updated it with the core files from the domain with the pdf upload issue. No issue pdf upload, so presumably there is nothing wrong with the core files. So I am thinking that I need to ask more questions with my hosting folk. Unless you can suggest anything else, apart from telling the client not to upload pdf files :-) Any advice guidance would be much appreciated. Thanks

Drew McLellan

Drew McLellan 2638 points
Perch Support

If the PDF isn't too big (doesn't sound like it is) that might be an idea.

Hi Drew I have spoken to my server folk and they told me that they have patched the server for Bash Bug/shell shock and along with this they updated imagick to version 6.8.9-7 They ask would this have any issue with the scripts? As I said before a week or so ago it worked fine. Really appreciate some help please. Thanks

Drew McLellan

Drew McLellan 2638 points
Perch Support

Imagick is used for producing thumbnails of PDFs - so it could be that it's imagick throwing the error.

Is imagick configured to work with a delegate for PDFs? It would normally use something like ghostscript.

Perch normally doesn't care if this is available or not, it will carry on regardless, but if imagick is present but not quite working as expected then that could potentially cause the error.

Thanks, So they tell me that they have tested a pdf file with imagick and it created two images OK. Ghostscript is available version 8.7.0 They are still suggesting that maybe something in script.

Even trying to use existing pdf assets causes a problem. I select an asset I see it but when I click save I get this: url domain/cms/core/apps/content/edit/?id=478 "The connection was reset The connection to the server was reset while the page was loading. The site could be temporarily unavailable or too busy. Try again in a few moments. If you are unable to load any pages, check your computer's network connection. If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web." When you log back into the cms the page you tried to add shows a Preview 'You are editing a draft' clicking undo clears the message.

Hi Drew So I asked the Server folk to remove imagick which they have done and all is working OK. Strange thing is that imagick was configured for pdf's Thanks for the help.