We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

File Manager

Development and Programming

lemunk's avatar
lemunk
2 posts
9 years ago
lemunk's avatar lemunk

Ive been tasked to create a simple download page for users on our site.

I want to us as much as the cms as possible rather than develop an extension.

What i would like to do is allow admins to upload some files on our server. I want a folder structure they can manage too. such as “folderParent” contains “folderChild1” and “folderChild2”.

they can upload files all day as much as they want, cool.

Then i wish to have my front end “downloads page display all the files available to download, and to keep the folder structure so they can navigate for downloading files such as click on folderParent etc etc.

However as far as i can tell for each folder and admin would need to set them up as a new upload section each time , this isn’t too bad i suppose, unless theirs a better way.

However when creating a template i want those files and Structure (folders) to be passed through too the front end. Basically if my admin uploads a file or creates a new destination sub directory for that file i want it to auto update the front end so the admin doesnt need to touch the template.

Is this doable via the cms? If not how much would i need to extend?

Thanks for any info guys!

       
Ingo Wedler's avatar
Ingo Wedler
63 posts
9 years ago
Ingo Wedler's avatar Ingo Wedler

For the front end part you could use php to get a directory listing, styling would up to you:

<?php
function listdir($dir)
{

$files = glob($dir . "*");

foreach($files as $file)
{
echo '<a href="http://www.yourdomain.com/download-directory/%27echo">';_echo $file;_echo '</a>';
echo '</br>';
}
}

Turn php parsing at output on, put it in a sub-template or snippet, and so on, and you get what you want for the front end. Just a thought. Dont get me about security, and the other things like back-end, I’m just thinking…

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
9 years ago
Kevin Cupp's avatar Kevin Cupp

Typically the File Entries tag would help out here but it’s not going to handle listing and navigating the subfolders, that’s the only problem. Sounds like you may need to go the route Ingo suggested and manually traverse the directories using PHP.

       
lemunk's avatar
lemunk
2 posts
9 years ago
lemunk's avatar lemunk

Ill give it a go lngo thanks for that dude!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.