In server i have a folder named "Image", how can i download all files inside this folder to my local folder ??
what i have tried.
WebClient Client = new WebClient();
Client.DownloadFile("http://serverip/File/Ticket-Photo/*", @"C:\\File\\*);
In server i have a folder named "Image", how can i download all files inside this folder to my local folder ??
what i have tried.
WebClient Client = new WebClient();
Client.DownloadFile("http://serverip/File/Ticket-Photo/*", @"C:\\File\\*);
You cannot do this via HTTP. There is no way to fetch a directory listing of a remote server, simply because the server doesn't provide a list of the directory contents.
If the server does provide the directory contents (Such as an index.html page in apache), you will need to parse through the HTML list, and then subsequently download each individual file.
Alternatively, if you're in control of the server, you can use another method to retrieve the files from the remote server (Such as FTP), which was designed to transfer files.
For more information on how to do this via FTP, see this question.