?
Solved

C#.NET FTP Request Error

Posted on 2008-10-21
6
Medium Priority
?
707 Views
Last Modified: 2012-05-11
I am running the following code:

//Set up the FTP connection
FtpWebRequest ftpRequest = (FtpWebRequest)WebRequest.Create(strFtpUri);
ftpRequest.Credentials = new NetworkCredential(strFtpLogin, strFtpPassword);

//Initiate the request and read the response
FtpWebResponse ftpResponse = (FtpWebResponse)ftpRequest.GetResponse();
Stream ftpResponseStream = ftpResponse.GetResponseStream();
StreamReader reader = new StreamReader(ftpResponseStream, System.Text.Encoding.UTF8);

This works fine on my client but when I run it on Windows Server 2008 I recieve an error @ line:
--  FtpWebResponse ftpResponse = (FtpWebResponse)ftpRequest.GetResponse();

The error states "The Remote Name Could Not Be Resolved".  Any ideas?
0
Comment
Question by:CipherIS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 1

Author Comment

by:CipherIS
ID: 22767702
I think the issues is Windows Server 2008 is not allowing connection to the FTP site.  Will check.
0
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 22768505
the following link gives a perfect coding sample fo ftp file upload and download
i am already using the code from this sample in my windows service on windows 2008 server
hope it helps
https://secure.codeproject.com/KB/IP/SimpleFTPDemo.aspx
0
 
LVL 1

Author Comment

by:CipherIS
ID: 22768704
Nope.  Still does not work.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:CipherIS
ID: 22768727
Nope.  Still does not work.  Works on the client but on Windows Server 2008 it is not working.  Any ideas?
FTP-Error.JPG
0
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 22770883
can you please share your code and the parameters you are passing to connect to the ftp website
the error says could not resolve ftp - to me it means that you are just passing ftp as the ftp site name and not the fully qualified name
more details will definitely help
0
 
LVL 1

Accepted Solution

by:
CipherIS earned 0 total points
ID: 22786222
It was the set up of the Windows 2008 server that prevented the FTP connection.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question