Forum

Thread tagged as: Problem, Runway, Members

Broken Thumbnails in Secure File Downloads

Perch Runway: 3.1.1, PHP: 7.2.8, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 38fea24f2847fa7519001be390c98ae0acafe387 $, with PDO
Server OS: Linux, fpm-fcgi
Installed apps: content (3.1.1), assets (3.1.1), categories (3.1.1), perch_blog (5.6.1), perch_events (1.9.5), perch_forms (1.11), chirp_seo (1.3.0), perch_members (1.6.4), perch_twitter (4.0)
App runtimes: <?php $apps_list = [ 'perch_blog', 'perch_forms', 'perch_events', 'perch_members', 'perch_twitter', 'chirp_seo', ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/teapco/public_html/perch
PERCH_CORE: /home/teapco/public_html/perch/core
PERCH_RESFILEPATH: /home/teapco/public_html/perch/resources
Image manipulation: GD Imagick
PHP limits: Max upload 16M, Max POST 16M, Memory: 128M, Total max file upload: 16M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
DOCUMENT_ROOT: /home/teapco/public_html
HTTP_HOST: teap.co.uk

I am using the members app with the secure download.php solution for files from a secure bucket that is outside of my public_html folder. It seems to be working and when I add a test PDF file a test-document-w150h150@2x.png file is created in the secure folder along with the uploaded PDF. I am using Imagick and have PDF files successfully generating thumbnails in other parts of the site. For these secure files I am getting a missing image in the Perch admin not the thumbnail as I would expect and I guess because it is generating the image I am not getting the non imagick generic icon either. If I look for the missing image in Perch it says it should be at https://teap.co.uk/secure-area/download/test-document-w150h150@2x.png

Any ideas much appreciated.

Greg Riley

Greg Riley 1 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you see the -thumb.png file being generated?

No all that is being saved in the secure bucket is test-document.pdf and test-document-w150h150@2x.png

If I change the template from bucket="secure" to bucket="general" the thumbnail is generated as expected and it seems to be using a file with the same name as is being generated in the secure bucket for the thumbnail. It seems like the Perch admin is also trying to download the thumbnail from the secure download method.

with secure bucket thumbnail is looking for image at:

https://teap.co.uk/secure-area/download/test-document-w150h150@2x.png

this fails.

The document link created works and downloads the PDF:

https://teap.co.uk/secure-area/download/test-document.pdf

With non-secure general bucket the thumbnail is shown at location.

https://teap.co.uk/perch/resources/general/test-document-w150h150@2x.png
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that sounds like what is happening. If you've configured the bucket to prevent direct access then that's how it behaves.

Is there any way to turn the creation of thumbnails off for this secure bucket?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't believe so, no.