Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Problem Uploading File Using FtpWebRequest

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
daveh42 - 18 Dec 2007 20:05 GMT
Hi,

We want to upload a file to a business partner using FTP with SSL from our
intranet. Our proof of concept solution in VB uses FtpWebRequest based on an
example at http://www.123aspx.com/redir.aspx?res=34336:

    Dim reqObj As FtpWebRequest =
WebRequest.Create("ftp://ftps.example.com:1742/123456789_12-31-2007")

    reqObj.EnableSsl = True
    reqObj.UsePassive = True
    reqObj.Method = WebRequestMethods.Ftp.UploadFile
    reqObj.Credentials = New NetworkCredential("username", "password")

    Dim streamObj As FileStream = File.OpenRead("D:\Files\123456789_12-31-2007")
    Dim buffer(streamObj.Length) As Byte

    streamObj.Read(buffer, 0, buffer.Length)
    streamObj.Close()
    streamObj = Nothing

    Dim reqStream As Stream

    reqStream = reqObj.GetRequestStream()
    reqStream.Write(buffer, 0, buffer.Length)
    reqStream.Close()
    reqStream = Nothing
    reqObj = Nothing

We are getting the error "Unable to connect to the remote server" on the
"reqStream = reqObj.GetRequestStream()" line. The username and password are
correct. What should we check next?

Thanks,

Dave
Scott Roberts - 18 Dec 2007 20:40 GMT
> Hi,
>
[quoted text clipped - 31 lines]
> are
> correct. What should we check next?

Firewall settings.

Can you connect to the remote server using a commercial FTP client? If so,
are you connecting with the same settings (SSL, Passive, etc.)?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.