Forum

Thread tagged as: Question

Create new bucket outside of Perch/Resources folder

I want my client's editors to be able to upload files to a folder for PDFs that produces a friendlier url than sitename/perch/resources/job-descriptions. So I've created a folder 'job-descriptions' at the root level.

Having read the support page about buckets I've created a buckets.php file for the config folder (and have included bucket="job-descriptions" in the file template) but am a bit stumped about the file path in my local mamp dev setup. I've created a folder 'job-descriptions' at the root level of the site, and buckets.php contains this:

<?php
    return array(
        'job-descriptions' => array(
            'web_path'  => '/job-descriptions',
            'file_path' => '/var/clientname.local/job-descriptions'
        )
    );
?>

In the editing area the file upload item is showing correctly but contains the warning "Your resources folder is not writable. Make this folder (/job-descriptions) writable to upload files." The folder is showing as read & write OK for all users in the info window (Mac). So I'm not sure if the error is because the folder really isn't writeable or if it's because the path to it is wrong in buckets.php.

Also, as an aside, I assume one doesn't have to include the default resources folder in buckets.php

Peter Hammarling

Peter Hammarling 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show us your diagnostics report?

Hi. Diagnostics from control panel:

Diagnostics report HEALTH CHECK Perch is up to date PHP 5.6.28 is up to date MySQL 5.6.34 is up to date Image processing available SUMMARY INFORMATION Perch: 2.8.34, PHP: 5.6.28, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO Server OS: Darwin, cgi-fcgi Installed apps: content (2.8.34), assets (2.8.34), categories (2.8.34), perch_forms (1.8.3) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', ); ?> PERCH_LOGINPATH: /perch PERCH_PATH: /Applications/MAMP/htdocs/medicarrera.local/perch PERCH_CORE: /Applications/MAMP/htdocs/medicarrera.local/perch/core PERCH_RESFILEPATH: /Applications/MAMP/htdocs/medicarrera.local/perch/resources Image manipulation: GD PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M F1: 6a33f95eca3667f9e0c39bf5ca2980fe Resource folder writeable: Yes SCRIPT_NAME: /perch/core/settings/diagnostics/index.php REQUEST_URI: /perch/core/settings/diagnostics/ DOCUMENT_ROOT: /Applications/MAMP/htdocs/medicarrera.local HTTP_HOST: medicarrera.local:8888

Drew McLellan

Drew McLellan 2638 points
Perch Support

So it would be

/Applications/MAMP/htdocs/medicarrera.local/job-descriptions

Great, thank you Drew.

It was the /var/... that threw me. I assumed that there needed to be a variable in there and if one is just copying code from your docs without understanding what it's doing, these mistakes happen.

Solved, thanks again.

I'm reopening this question as the same problem arises on the live site as I had in my local setup.

I cannot upload docs to the bucket 'job-descriptions', which is at the root level of the site. Perch admin for the region in question is telling me that the resources folder 'job-descriptions' is not writeable, even though ftp apps and the site's own control panel are telling me that the folder is writeable by everyone. Seeing as the same message appears in admin, whatever path I put in the buckets.php file, it makes me wonder if the problem is really the path to the folder, rather than the folder not being writeable.

The diagnostics are these:

Perch: 2.8.34, PHP: 5.6.17, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO

Server OS: WINNT, cgi-fcgi

Installed apps: content (2.8.34), assets (2.8.34), categories (2.8.34), perch_forms (1.8.3)

App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', ); ?>

PERCH_LOGINPATH: /perch

PERCH_PATH: D:\XVRT\medicarrera.com\Html\perch

PERCH_CORE: D:\XVRT\medicarrera.com\Html\perch\core

PERCH_RESFILEPATH: D:\XVRT\medicarrera.com\Html\perch\resources

Image manipulation: GD

PHP limits: Max upload 64M, Max POST 8M, Memory: 128M, Total max file upload: 8M

F1: 

Resource folder writeable: Yes

SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

REQUEST_URI: /perch/core/settings/diagnostics/

DOCUMENT_ROOT: D:\XVRT\medicarrera.com\Html

HTTP_HOST: www.medicarrera.com

and buckets.php contains this:

<?php
    return array(
        'job-descriptions' => array(
            'web_path'  => '\job-descriptions',
            'file_path' => 'www.medicarrera.com\job-descriptions'
        )
    );
?>

I've tried dozens of different path possibilities including: D:\XVRT\medicarrera.com\Html\job-descriptions but the message "Your resources folder is not writable. Make this folder (\job-descriptions) writable to upload files" remains and I'm not able to upload to the folder.

I'm not sure what else to try and would appreciate some pointers.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, it looks like your file path should be:

D:\XVRT\medicarrera.com\Html\job-descriptions

and the web path:

/job-descriptions

Thanks for confirming, Drew.

It turns out that on a Windows server one can only turn on permissions via the hosts control panel, even though in another section of the same panel it tells you that the folder is already writeable. One has to activate everything in '/' and then trust it to inherit down. It's not an intuitive affair at all. Anyway, solved.