Forum
Problem with resource bucket
Hi, I have version of Perch 2.5.1 I uploaded a folder/directory inside resources named datasheets, which contains a number of files also uploaded to the server. I created buckets.php uploaded inside folder/directory config.
<?php
return array(
'datasheets' => array(
'web-path' => '/cms/resources/datasheets/',
'file-path' => '/var/www/vhosts/domainName/httpsdocs/cms/resources/datasheets/'
),
);
The resource folder is set to permission 777 and the datasheets folder has also been set to 777. In templates/content I have the following:
<perch:repeater id="datasheetBox" label="Data Sheets" max="40">
<perch:before><table id="datasheet"></perch:before>
<tr><td><perch:content type="text" id="MSDS" label="Datasheet Name"/></td><td>
<a href="<perch:content type="file" id="datasheet" label="Data Sheets MSDS" bucket="datasheets"/>" target="_blank" /> MSDS</a>
</td></tr>
<perch:after></table></perch:after>
</perch:repeater>
So the problem I have is I can not see the bucket 'datasheets' in the cms admin and if I look at an already uploaded datasheet I see this error:
Warning: mkdir(): Invalid path in /var/www/vhosts/domainName/httpsdocs/cms/core/lib/PerchUtil.class.php on line 846
Your resources folder is not writable. Make this folder () writable to upload files.
Yet clearly the folder is writable. Can you tell me please what I have missed as clearly other folk have it working. Many thanks
What happens when you upload to this bucket?
Hi Drew How can I do that if I cannot see the bucket in assets all I see is the default bucket.
By adding the
bucket
attribute to an image or file field. The bucket won't appear in the Assets app until something's been uploaded to it.Sorry I am unclear about adding the bucket attribute... did I not do this <perch:content type="file" id="datasheet" label="Data Sheets MSDS" bucket="datasheets"/>?
Tried to upload a file still on a new page still cannot see the bucket datasheet. So if I try and upload a file to a new page I see this: Warning: mkdir(): Invalid path in /var/www/vhosts/domainName/httpsdocs/cms/core/lib/PerchUtil.class.php on line 846 Your resources folder is not writable. Make this folder () writable to upload files. Means I am unable to upload a new file. Checked the folders and permissions set to 777
Ah:
Ah.. I am lost Is the issue with the permissions? Warning: mkdir(): Invalid path in /var/www/vhosts/domainName/httpsdocs/cms/core/lib/PerchUtil.class.php on line 846
if (!file_exists($bucket['file_path'])) { $success = mkdir($bucket['file_path'], 0755, true);
No - the typos. You've used
file-path
instead offile_path
Brilliant thanks again