I have a small function that uploads and download through c# WebClient. I just want to make sure if this is the correct way of doing it without breaking any security rules. This currently work for my application but i am just wondering is the way im doing it is right?
WebClient client = new WebClient();
client.Proxy = new WebProxy();
client.Credentials = new System.Net.NetworkCredential(_username, _password);
client.BaseAddress = _URLPath; // ftp://10.10.10.10/
client.UploadFile(_filePath.Substring(_filePath.LastIndexOf("\\") + 1), _filePath); //filePath = C:\\text.bak
client.DownloadFile(myFile, myFile); //Download myFile = "text.txt"
client.Dispose();
Basically the application uploads a file called "text.bak" from my C:\ and the server right away generates a text file from that called "text.txt" and i download it right away.
Am i leaking any security issues? Thanks