View directory

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
whitewabbit
New Member
New Member
Posts: 6
Joined: Thu Apr 04, 2013 12:21 pm

View directory

Post by whitewabbit »

I am looking for a way to view all the files in a specific directory based on the page users are on (eg. page 1 show files in directory A, page 2 show files in directory B etc) I can do it kind of with the download manager plugin but you have to upload one file at a time and assign a user at a time to it which is not practical given the number of files I have to use.

is there a plugin that will do this? Or maybe a bit of code I can drop into a page? I would also like to show the files size as well at the file name and do not want the users to be able to navigate outside the assigned directory.

Any help would be appreciated.
Thanks
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: View directory

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: View directory

Post by velden »

You might want to have a look at the 'assign' tag of Smarty.
Small example (not tested):

Code: Select all

{assign var='teaser' value='uploads/images/teaser/*.JPG'|glob}
{foreach from=$teaser item='one'}
     <div><a href="{root_url}/{$one}">{$one}</a></div>
{/foreach}
Of course you can change the file mask and do some other stuff before displaying
whitewabbit
New Member
New Member
Posts: 6
Joined: Thu Apr 04, 2013 12:21 pm

Re: View directory

Post by whitewabbit »

Yes that's right, works fine thanks. the only other thing that would be good to have would be a tick box next to each file and a download button at the bottom. Don't think you can do that with this but in a perfect world that's what I want to do if I can.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: View directory

Post by velden »

whitewabbit wrote:
Yes that's right, works fine thanks. the only other thing that would be good to have would be a tick box next to each file and a download button at the bottom. Don't think you can do that with this but in a perfect world that's what I want to do if I can.
Guess that would involve a kind of client side download manager and/or a server side module to zip the (shopping cart) and deliver it as one downloadable file.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: View directory

Post by Rolf »

Try Uploads module!
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “Modules/Add-Ons”