I want to transfer folder from client to server. I found the code on this link to transfer file and its working fine.
But i want to transfer multiple files and there is an error as only 1 files is transferred. I modified the code and used FolderBrowseDialogue instead of OpenFileDialogue. I have used following code to transfer file.
foreach (string f in Directory.GetFiles(dir))
{
FTClientCode.SendFile(f);
}
I found the problem. The problem was at serverside when backgroundWorker1 was calling StartServer(), so server was started only once and this function was never called again, So i wrote StartServer() at the end of StartServer() function so after getting file it server starts again and waits for next file to be received. This is not good as a function is calling itself again and again and there is no end point. But my requirement was only to receive files and do nothing else so that is why I used it.