We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question

Help with Secure Downloads

Hello, I'm trying to setup a digital product with secure asset download following this guide.

I have created the bucket like this (local mac machine). The web root is /Users/me/sites/mysite/www. Both directories under mysite have the same permissions.

<?php 
    return [
        'guides' => [
                'web_path'  => '/guides/download/',
                'file_path' => '/Users/me/sites/mysite/guides',
        ],
    ];
?>

Then, when trying to add a pdf to the bucket I get Warning: mkdir(): Permission denied in /var/www/html/admin/core/lib/PerchResourceBucket.class.php on line 158 and to the admin area Your resources folder is not writable. Make this folder (/guides/download/) writable to upload images.

I'm a bit confused with this error because from this guide, I understand that it is the file_path that holds the file however the error complains about permissions of the web_path!

What am I missing here?

Thanks!

Proko Mountrichas

Proko Mountrichas 3 points

  • 7 months ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

The error shows the web path in an attempt to be more understandable. The bottom line is you need to fix the file permissions on that folder so that the process that runs PHP can read and write to the folder.