Click here to Skip to main content
14,607,970 members
Rate this:
Please Sign up or sign in to vote.
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.

Updated 24-Dec-10 21:34pm
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

Rate this:
Please Sign up or sign in to vote.

Solution 1

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.
Manfred Rudolf Bihy 25-Dec-10 4:02am
Good Answer! 5+
See my comment on OP's question :) 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.
Espen Harlinn 26-Feb-11 11:23am
Good reply - my 5
Sergey Alexandrovich Kryukov 26-Feb-11 17:55pm
Thank you.
Sergey Alexandrovich Kryukov 26-Feb-11 17:56pm
You're welcome.
Thank you for accepting my Answer, call again.

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100