Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I am using FTPWebRequest and FTPWebResponse to transfer files on a ftp server window based, which is working good. But while I try the same code to transfer files on a ftp server unix based, it returns the error - "Unable to connect the remote Server". However, every credential is correct.

Please explain the connection settings difference for Linux, Unix and Windows Server.

Regards!
Aman
Posted
Updated 24-Dec-10 21:34pm
v2
Comments
Manfred Rudolf Bihy 25-Dec-10 4:01am    
Hi Aman, I totally agree with what SAKryukov said in his answer and would like to point this out:
From the machine you're running the ASP.NET application on you should try to do ftp to the unix server either from the command line or with internet explorer.
If you get the same issues there it's most likely a firewall issue, given that the credentials are correct. Please try it out.

1 solution

I only did setup of different FTP servers on Unix (Ubuntu Linux Server) and can tell you these are different server products and/or server settings that make the difference, not the platforms. I fail to see any essential difference between server's platform, except Microsoft tends to work in case-insensitive due to Windows file system.

I've different question: how do you know the credentials are correct?
Try to connect to Unix Server using some available client (did you try? and what?).

One difference between different servers on Unix is different settings for anonymous setup. Check if you used anonymous account. In some cases, even if it does not require password, some arbitrary password string should be supplied.

Another problem could be passive mode. FTP actually uses two one-way channels, with the port of second channel assigned dynamically, but the available range is defined in server's configuration. If there is a firewall, this range should be taken into account (in firewall data). This is a very usual case of firewall blocking FTP connection.
 
Share this answer
 
Comments
Manfred Rudolf Bihy 25-Dec-10 4:02am    
Good Answer! 5+
See my comment on OP's question :)
Aman4.net 25-Dec-10 5:04am    
Hi SAKryukov, Thanx for your answer! I tried the credentials with COREFTP and was able to upload and download files. I have already disabled my firewall. Now I am going to check the passive mode. Let me know if any another point comes in your mind or any code snippet.... Your suggestion will be appreciated.
Sergey Alexandrovich Kryukov 26-Feb-11 17:55pm    
Thank you.
--SA
Sergey Alexandrovich Kryukov 26-Feb-11 17:56pm    
You're welcome.
Thank you for accepting my Answer, call again.
--SA
Espen Harlinn 26-Feb-11 11:23am    
Good reply - my 5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900