I have a project that requires me to upload multiple files to an FTP server. I have the code working perfectly as long as I upload one file and close the connection. The problem I am running into is when I try to upload more than one file. I keep getting
different errors depending on how I configure the code. For example, I can upload the first file using a WebRequest... and then run the Stream and upload fine. However, when I go to the second file, I run into an error where it tells me that the Stream is
not clsed. Not a problem, I can close the Stream but I run into a problem on the second file because I get a differnet error telling me that the Stream is open. We configured the code to open the connection upload the file, close the connection, open another
connection upload the file and close it but that is causing problems.
My goal is to open a session, open the Stream, upload the file, go to the next Stream and upload the file, and close stream and connection. Basically I want to upload the files just as if I was using a BAT file, which by the way works great, but I want
to accomplish all of this with C# instead of calling a BAT file. I pasted the code below and I would really appreciate your help. I need to upload the files in order and not all at once.
Thank you in advance
FileInfo ToUpload = new FileInfo("D:\\FTP\\FTPScripts" + "\\&quo
View Complete Post