Folder prompt

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
dayhuffb
Forum Newbie
Posts: 8
Joined: Thu Aug 12, 2004 5:45 pm

Folder prompt

Post by dayhuffb »

I have created a php page which logs into a remote ftp server, and downloads which ever files the user chooses. I'm trying find a way for the user to select what folder they would like the files downloaded to. I came acrossed, "header("Content-Disposition: attachment; filename=file.txt");", but that requires the user to browse for every file they want to download. I want to browse only once for a folder to place all the files into. I would just place a text box on the form, but browsing would not only be much easier for the user, but also cut down on typos. Is there anything in PHP which does this?

Thanks in advance
~Brad
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

outside of packaging all the files into a zip or other archive, your users will have to download each file individually... that's if you want your users to download the files onto their machine. If you want to download the files onto the server, that's a different story. That would be accomplished by just looping through the files/folders you wish to get the ftp server in your script..
dayhuffb
Forum Newbie
Posts: 8
Joined: Thu Aug 12, 2004 5:45 pm

Post by dayhuffb »

Thank you for the quick reply. Do you know of any web languages which enable you to download multiple files at once without zipping the files? Or is this just a universal limitation of web programming?

Thanks Again
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it's a security risk to allow a web page access to your file system. The browser would have to support multiple file saves, of which, I know none that support such a feature for downloading..
Post Reply