Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Upload Entire Directory

Status
Not open for further replies.

mike2277

Programmer
Mar 25, 2002
54
US
Hi,
I am wondering if anyone knows how to write code that would allow users to upload an entire directory from their computer to my server. I currently have a way for them to upload single files at a time but this is burdensome if the user needs to upload 30 or 40 files in a directory. Is there a way to do this without having to set up each user with their own ftp username and password?

In other words, each user has their own directory on the server and I just want them to be able to upload entire directories from their machine to their own directory on my server without having to use an FTP program.

Thanks for the advice!

Mike
 
ColdFusion (running on a remote server) doesn't really have visibility to files/directories on a users system (believe me... this is a good thing).

The only window into the clientside filesystem is via HTML 2.0's "FILE" input type... and by it's very definition, it only handles single files. And, thankfully, you can say "look in the same directory and upload all the files located there"... can you imagine the anarchy that would ensue if you could?

What you can do, though, is have multiple FILE inputs on the same page... so at least the user doesn't have to do a form submit for each single file... they could load up, say, 10 file inputs then submit the whole page.

Other than that... FTP is probably your best bet. Unless you're really skillful at writing Java apps or OCX's.

Or... install ColdFusion server on all your user's machines... then you'd be able to do it. Doesn't sound like much fun, does it.


-Carl
 
Thanks so much for the advice Carl. I was really curious to learn more about this. I did find an application that allows multiple upload fields on a single page so it sounds as if I'll be looking into that.

Thanks again!

Mike
 
I was looking for this exact same thing a few months ago and I came across this:


It's a JAVA applet designed for specifically uploading multiple files at once. It works great!! Download the demo, it's free, fully customizeable (CF code, I mean), and it comes with 4 or 5 variations for different upload/download situations. It even has several real working examples of using it with CF and ASP. I basically just modified the CF example and put it into production. It has a lot of features, like specifying what file types can be uploaded. ;^)

Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top