Page 1 of 1

select folder

Posted: Fri Aug 29, 2003 5:09 am
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

Posted: Fri Aug 29, 2003 6:31 am
by Judas
there is no way to upload a dir by file.input

(zip, gzip, gz the dir and then upload by file.input)

yes but ...

Posted: Fri Aug 29, 2003 6:54 am
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.

Posted: Fri Aug 29, 2003 8:39 am
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.

Posted: Fri Aug 29, 2003 1:05 pm
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/

Posted: Fri Aug 29, 2003 6:39 pm
by Judas
your right my avatar isn't what it supposed to be.
ill change it soon.

Posted: Fri Aug 29, 2003 7:01 pm
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.