Hello,
I have looked through the search results and have not found the answer to my question. I'm trying to find a way for users to see all the files inside a directory without using ftp client. Not sure if its possible. I'm not a web-developer.
Here's what I'm looking for:
1. User/Admin uploads file to folder using an ftp client. (ex. I upload a file to www.abc.com/download folder using ftp client)
2. User/Admin goes to abc.com/download and is able to see the uploaded file and other uploaded files inside the "download" folder
So basically, I was wondering if Drupal can automatically "create" a page that shows all the files inside that directory so users can easily pull files off there instead of having to type the exact filename to pull it out.
Alternatively, I was wondering if it was possible to make e.g. the download page to be "Drupal free" so when a user visits abc.com/download, the user sees the directory mode thingy.
Thank you in advance for all your help!
Comments
I'm curious about this too.
I'm curious about this too. It's quite similar to what I want to do.
bump?
Yes. Bump. =)
please?
Anyone know a solution?
The following code will list
The following code will list all the files (not directories) in directory of the current script. If you want it to list a different directory, you would need to change the $folder variable. Is that what you're looking for? Example
FYI, this a very crude way of doing it.
Thank you davedelong!
Yes, I think this is what I am looking for. THANK YOU SO MUCH!! I was just wondering where I would paste this script?
If my download directory is www.abc.com/download/
Do I create a php file named index.php and place it there? Would Drupal override the php file and say "www.abc.com/download/ does not exist"?
Thanks again for your help =)
Here's the way I would
Here's the way I would probably do it:
1. Make sure that you have the PHP Filter turned on. This allows you to create Drupal Pages that execute PHP snippets when run.
2. Figure out what the path to your site root is. This is easily done by creating a php file (temp.php) in your site root and putting this code in it:
echo dirname(__FILE__);3. Create a new Drupal page, and use the following code (almost like the code above, just modified a bit):
4. Save your page
This will give you a page like this one. So it works, but you don't get any snazzy features with it like download counting or whatnot.
Cheers,
Dave
Awesome. You're my website
Awesome. You're my website lifesaver!! lol.
Small problem
My php is enabled. I created a new page, pasted the code, entered my $root and $dir... and then posted the page.
There are files in the /x directory (the directory that I set it to). However, what I see is only this line:
Listing files in /xNot sure why that is. Any ideas? Thanks in advance.
Is the folder world
Is the folder world readable?
Yes.
The CHMOD is .. 755
daviestown contacted me off
daviestown contacted me off list, and after about 15 seconds we noticed that he was missing the initial slash on his root url. Once that was put in, everything was fixed.