FTP Error 550

Hello... I'm a newbie programming in .NET C# having trouble uploading files to an FTP Server. I use the background worker to upload the files.
What the program does is just upload files selected by the user to a static ftp server.
The first selected files are sent well, but when the program finishes the first files, I give the user the option to go back and select some more files to send, and then it's when the 550 error happens.
I can't figure why this happens because the filename is right and doesn't exist in the server; the path is right, the user has access.

The function that uploads is pasted in the following URL:
http://www.wilcob.com/Wilco/Pastecode/5133/showpaste.aspx

I could use some help, and I welcome all attempts.
Thanks.

[777 byte] By [neskk] at [2008-1-9]
# 1
You'll have to verify the granted user rights, because error 550 means that the user does not have sufficient priviliges...
timvw at 2007-10-2 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 2
The user rights are OK. Just think... if I can upload the first files without a problem why would it be a user rights problem.
neskk at 2007-10-2 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 3

550 means "Requested action not taken", and it can be caused by access permissions, but also other causes such as invalid path or file name.

Does the server send any accompanying text along with the 550 error code to give more details as to the problem? Also you might try a network sniff comparing the first successful upload with the first unsuccessful upload to see what you're doing differently.

Lance

http://geekswithblogs.net/Lance

Lancereno at 2007-10-2 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 4
The FTP server doesn't return anything more besides the 550 Error.
The Path is valid, I've tested it, and the file doesn't exist.
If I could see the FTP log maybe I could see the problem but I don't know how...
neskk at 2007-10-2 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 5
This is still a mistery... I can't find any work around... isn't there anybody that can help me?
neskk at 2007-10-2 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 6
The exact error is: The remote server returned an error: (550) File unavailable (e.g., file not found, no access).
neskk at 2007-10-2 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 7

Well, if the file does not exist, and you're trying to download it the 550 error is the correct behavior you should get.

To see the log, you can either use System.Net log tracing or Network Monitor. Instructions on how to use those can be found here

http://blogs.msdn.com/dgorti/archive/2005/09/18/471003.aspx

http://blogs.msdn.com/dgorti/archive/2005/10/29/486887.aspx

Mariya

MariyaAtanasova-MSFT at 2007-10-2 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 8
I'm not trying to download it... I'm trying to upload it!
Nobody had a look at the code...
Trying to get the log now to see if I can understand the error.
neskk at 2007-10-2 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 9

You can copy/paste the results from the trace log and we'll take a look.

If you're uploading, then 550 means that the path is not correct.

I looked at your code and this line jumped at me:

string uri = "ftp://" + ftpServerIP + "/" + ftpPath + filename;

Does ftpPath end with "/"? If not you have to add it the way add after ftpServerIP.

Mariya

MariyaAtanasova-MSFT at 2007-10-2 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 10
Finally found the problem. Can't understand how I couldn't see it in the first place.
The problem was indeed the ftpPath but it was not the slashes. It was an concatenation that wasn't on the code I've posted.
Now the problem is solved. Thank you all.
neskk at 2007-10-2 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...

.NET Development

Site Classified