Forum
Members Area - Listing files in a secure bucket
Is there away to list all the files in a secure bucket?
I have uploaded the files and setup the bucket in the bucket.php. Rather than adding the files to a page manually is there a away to do this programmatically through perch?
I am using the latest version of Perch 2 downloaded last week. Perch: 2.8.34.
Many thanks
You could display the region using a template that only outputs the file details.
Hi Drew,
Thanks for the reply. How do I get the file details? Is this just some basic php?
Dennis
No, just a Perch template. What does the template for uploading your files look like at the moment?
Hi Drew,
My templates looks like this
Ok, so you'd be able to get a list of the files by displaying the region using that template, wouldn't you?
Hi Drew,
It appears to not be working.
The gutts of the members page looks like this
and the template I have used for the 'Download Files' is
so what you are saying is that this should list the files on my members page?
System Diagnostics
Dennis
Hi Dennis,
the
file
field type lets you upload a file (to a bucket) and then display the path to that file on your page output. If you want to upload multiple files to display on your page, you would need multiplefile
fields - possibly in a repeater.How did you upload the files to your bucket?
I upload the files through the back office. The template I use is just one off the documentation.
Just confused as to why the files are not being listed in the members area. I agree that I possible need a repeater there as I will need to upload multiple files.
Your template snippet certainly looks OK.
Have you enabled debug on the members page - it may help pinpoint what is happening during output.
I have enabled debug and the extract looks like this;
Does it help? I cannot see anything obvious
I can see where it's calling your menu templates
and a breadcrumbs template
But I can't see where it's calling another template - your Download Files template.
Maybe reduce members-area.php to only a simple call to Download Files and try and debug that...
Hi, I have deleted the page, re added it, reduced the page to just call the 'Secure Download' but still no debug info for the template.
Anymore ideas?
Have you added these files to a content region, or are they just in Assets as library items?
Sorry Drew, Spent so much time looking at this is has made me thick? I do not understand what you mean. The items are added to the secure bucket via the template above. Not sure what you mean about the region.
Your template uses a
<perch:content>
tag, so presumably it's either used by a content region or a collection. Is that not the case?