0

I'm writing an C# application, where the user can select an entire folder and click on a button to upload the folder he choose.
It is possible to upload an entire Folder to a Server(with all its files and sub folders) ?
I found in the web examples, to how to upload a single file but not an entire folder, If some one have a link or an a piece code I'll appreciate.

Thanks in advanced

3
Contributors
3
Replies
5
Views
9 Years
Discussion Span
Last Post by iciku
0

Sure it's possible! The trick is to scan the directory using System.IO.Directory.GetFiles() and System.IO.Directory.GetDirectories() [make sure to do it recursively]

Then you can upload each file one at a time. If you need help with that here's a link to my site on uploading files via FTP.

By the way, you can use FTP functions to create the directory structure in the server if you needed to.

Hope that helps!

0

Thanks for the response, I don't have ftp server and I don't want to create one.
I was wandering if there is a way to upload the entire directory not with ftp.
I found examples how to upload multiple files using the FileUpload control, but the problem is that the user has to choose every file at the time.
I someone know how to add files to the FileUpload control in a silent way(without prom it to the user), this should help.
Thanks in advanced

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.