I admit that I don't do web programming too much, so there's probably(likely) a better solution. However, with that disclaimer behind us, what you *could* do is look up the NET::FTP module. It offers functions for you to copy whole directories over. (If you have the Perl Cookbook, its in there) | [reply] |
I would try using expect. If for no other reason, just to add this amazing tool to your toolbox. Boiled down, it is a scripting language to automate programs that require user input. I.e. in this case ftp. You can write a *very* simple script that will upload just the files you want. I know someone that uses this to develop a whole website at home, and then just has expect scripts to tar everything up, upload it, untar, etc. etc.
I know this may be a bit heretical, but hey, the right tool for the right job, right? I'm sure we all believe that, no matter how much some of us wish to believe perl is always the right tool for the right job. ;)
Justin Eltoft
"If at all god's gaze upon us falls, its with a mischievous grin, look at him" -- Dave Matthews | [reply] |
If you're trying to do this through a CGI script, then no, there's no convenient solution. Multiple upload boxes are the way to go. The CGI protocol does not allow for any "mass upload" or "upload directory" methods and Perl itself is simply running on the server and doesn't affect the client. Perhaps your users can tar or zip the directory and just upload the result? That would be much simpler, if you can train them to do it.
There might be a Javascript or Java solution, as these can run on the client side, there may be a way to do this. However, they are very restricted in what they can do for security reasons. No one wants malicious Javascript browsing through your files.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
| [reply] |
| [reply] |