infotechelg
asked on
Strange FTP Issue via .NET
I have C# code that FTP files. This has worked without issue since the code was written.
Recently, I was given a new server location to drop these files. The only code changes I made were the FTP location and the credentials. No other code changes were made.
Anyway, when I run the code, it executes with no errors. Everything appears to have worked. But when I use an FTP client to make sure the files made it on to the FTP server, there's nothing there.
I reached out to the FTP site owner to ask him to check his FTP's log files. He said he sees me connecting and doing a transfer, but there's no files in the transfer.
FWIW, when I try to FTP files via the client, there are no issues.
I'm at a loss considering this worked with the old FTP site, and that I've changed no code other than the credentials.
Any ideas?
Thanks in advance for your help.
Recently, I was given a new server location to drop these files. The only code changes I made were the FTP location and the credentials. No other code changes were made.
Anyway, when I run the code, it executes with no errors. Everything appears to have worked. But when I use an FTP client to make sure the files made it on to the FTP server, there's nothing there.
I reached out to the FTP site owner to ask him to check his FTP's log files. He said he sees me connecting and doing a transfer, but there's no files in the transfer.
FWIW, when I try to FTP files via the client, there are no issues.
I'm at a loss considering this worked with the old FTP site, and that I've changed no code other than the credentials.
Any ideas?
Thanks in advance for your help.
Did you recompiled the application under the same .Net Framework?
ASKER
Yes
Can you post the section of code that you did change.
ASKER
The ftp class that you are using, is it a 3rd party code? if so who is the developer company?
ASKER
Hi infotechelg;
It looks good as you might of expected. The only thing I would try is to enable Network Tracing in your application and send to a file and see if you see anything that is not right. I have not done this in a while but there is a MS doc that explains it and can be found at Network Tracing in the .NET Framework Please give that a try. The line of code that will cause and that you want to see messages from is, reqStream.Write(data, 0, data.Length);.
It looks good as you might of expected. The only thing I would try is to enable Network Tracing in your application and send to a file and see if you see anything that is not right. I have not done this in a while but there is a MS doc that explains it and can be found at Network Tracing in the .NET Framework Please give that a try. The line of code that will cause and that you want to see messages from is, reqStream.Write(data, 0, data.Length);.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also, it looks like the Upload method include a reference to "host" which is defined by a host IP (that is assigned when the ftp class is instantiated). Are you passing the right host IP ?
ASKER
Ugh. This ended up being very dumb. :) Dumb on my part. I got on TFS and looked at the old code. The "host" being passed in to the ftp instance was "ftp://ipaddress". When I changed the code, I got rid of the "ftp://" on accident. I didn't discover this until Megan asked if I had debugged the "upload" method. And duh...I hadn't. I put the "ftp://" back in with the new IP and it works.
It's Monday....
:)
It's Monday....
:)