Click here to Skip to main content
15,917,991 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can any one tell me how to upload a directory and its sub directories on server uisng ftp, i can upload a FILE but what about folders??

You need to get the filestructure using below code

string[] dirs=Directory.GetDirectories(path, "*.*", SearchOption.AllDirectories);

And using foreach u have to create all the directories which in that array "dirs"

then u can copy the files
All the best
Share this answer
savp 13-Oct-11 2:58am    
okay thanks, this is surely gona work, but still do u have any readymade library or class on c#???
You will need to navigate the folder structure, creating directories on the remote server where necessary, and upload each file individually.
Share this answer
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900