select folder

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
yaron
Forum Contributor
Posts: 157
Joined: Fri Aug 22, 2003 8:40 am

select folder

Post by yaron »

Hi all,
I have wrote a script that getting folder properties.
What I want is to be able to browse my computer and to choose a folder and send it to the script I wrote.
It's not possible with <input type="file"> because it doesn't let me to choose directories.
any solutions?
Thanks
Judas
Forum Commoner
Posts: 67
Joined: Tue Jun 10, 2003 3:34 pm
Location: Netherlands

Post by Judas »

there is no way to upload a dir by file.input

(zip, gzip, gz the dir and then upload by file.input)
yaron
Forum Contributor
Posts: 157
Joined: Fri Aug 22, 2003 8:40 am

yes but ...

Post by yaron »

I don't want to upload a dir just to be able to select one (from in my server) and send the path (only the path) to a script that will get the proper data.
Judas
Forum Commoner
Posts: 67
Joined: Tue Jun 10, 2003 3:34 pm
Location: Netherlands

Post by Judas »

you whant a dir. tree in your script so you can browse the server.
I use it myself fore cm's.
I got a large engine writen for the yob.

started with a rec.dir lookup place the data in an array
make the array like this $maps[$rows][$cols].

this is the start for your table design.
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

wait. i think you're not being clear...and judas' avatar is bugging me for some reason. i think it's blinking too fast. i dislike gifs for avatars for this reason: a badly done gif gets irritating really fast.


anyway... i got the feeling you have a script on your computer
and you want itto filter a directory on a remote server.

if i'm right, your issue is this: you neeed to have yourself set as a server.....



put: $dir_to_check=$_GET['dir'];
into your script.
now modify it so it acts upon $dir_to_check

now.... call the page in your browser with :
page.php?dir=http://wwww.YourServer.domain/path/to/directory/
Judas
Forum Commoner
Posts: 67
Joined: Tue Jun 10, 2003 3:34 pm
Location: Netherlands

Post by Judas »

your right my avatar isn't what it supposed to be.
ill change it soon.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

I think you might want to look at the readdir() function: http://uk.php.net/manual/en/function.readdir.php

As you loop through a folder's contents, you'll also need an is_dir() test to check that the current item is in fact a folder and not a file.
Post Reply