Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. FTP

FTP

Scheduled Pinned Locked Moved ASP.NET
csharpsysadminquestion
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    niceguyeddie1999
    wrote on last edited by
    #1

    Hi, Im using c# to develop a web application and basically I need to ftp files over to a server. Is there any functionality in c# to do this or will I have to use an external library and if so any recommendations? Thank in advance Stephen

    M D M I 5 Replies Last reply
    0
    • N niceguyeddie1999

      Hi, Im using c# to develop a web application and basically I need to ftp files over to a server. Is there any functionality in c# to do this or will I have to use an external library and if so any recommendations? Thank in advance Stephen

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      Try looking at WebRequestMethods.Ftp[^] in the System.Net namespace of the 2.0 framework.

      1 Reply Last reply
      0
      • N niceguyeddie1999

        Hi, Im using c# to develop a web application and basically I need to ftp files over to a server. Is there any functionality in c# to do this or will I have to use an external library and if so any recommendations? Thank in advance Stephen

        M Offline
        M Offline
        Mike Ellison
        wrote on last edited by
        #3

        ...and the FtpWebRequest[^] class. Here's a link to a cp article showing an example of use: http://www.codeproject.com/vb/net/FtpClient.asp[^]

        N 1 Reply Last reply
        0
        • N niceguyeddie1999

          Hi, Im using c# to develop a web application and basically I need to ftp files over to a server. Is there any functionality in c# to do this or will I have to use an external library and if so any recommendations? Thank in advance Stephen

          D Offline
          D Offline
          Daniel Santillanes
          wrote on last edited by
          #4

          This is yet another library, in case you are using .net 1.1 I think it's stable and work ok for me. C# FTP Client Library[^] daniero

          1 Reply Last reply
          0
          • N niceguyeddie1999

            Hi, Im using c# to develop a web application and basically I need to ftp files over to a server. Is there any functionality in c# to do this or will I have to use an external library and if so any recommendations? Thank in advance Stephen

            M Offline
            M Offline
            Matthew Hazlett
            wrote on last edited by
            #5

            Microsofts support for FTP is just pathetic. You can use this library (its free) http://www.smartftp.com/ftplib/[^] (From the makers of Smart FTP) I have tried it out and found it works very well... Matthew Hazlett EDIT: Oops Sorry, it used to be free... -- modified at 19:34 Tuesday 24th January, 2006

            1 Reply Last reply
            0
            • M Mike Ellison

              ...and the FtpWebRequest[^] class. Here's a link to a cp article showing an example of use: http://www.codeproject.com/vb/net/FtpClient.asp[^]

              N Offline
              N Offline
              niceguyeddie1999
              wrote on last edited by
              #6

              Hi Thanks for your response, I tried using this but Im getting problems. I can connect to the ftp server and list directory ok, but when I try to upload a file I get "550 : Access is denied". The credentials I am using are the exact same as what I use when using all other ftp clients. Is there something I am missing? This is the code: FtpWebRequest ftpRequest = (FtpWebRequest)FtpWebRequest.Create(ftpLocation); ftpRequest.Method = WebRequestMethods.Ftp.UploadFile; ftpRequest.Credentials = new NetworkCredential(FTPUsername, FTPPassword); ftpRequest.UseBinary = true; StreamReader sourceStream = new StreamReader(pathOfFileToBeFTPd); byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd()); sourceStream.Close(); ftpRequest.ContentLength = fileContents.Length; Stream requestStream = ftpRequest.GetRequestStream(); <-----Throws WebException

              1 Reply Last reply
              0
              • N niceguyeddie1999

                Hi, Im using c# to develop a web application and basically I need to ftp files over to a server. Is there any functionality in c# to do this or will I have to use an external library and if so any recommendations? Thank in advance Stephen

                I Offline
                I Offline
                Ista
                wrote on last edited by
                #7

                Have your tried doing the FTp function through IE first. This will verify whther the user, password, and location are correct. 1 line of code equals many bugs. So don't write any!!

                N 1 Reply Last reply
                0
                • I Ista

                  Have your tried doing the FTp function through IE first. This will verify whther the user, password, and location are correct. 1 line of code equals many bugs. So don't write any!!

                  N Offline
                  N Offline
                  niceguyeddie1999
                  wrote on last edited by
                  #8

                  how do you do a put through IE?

                  I 1 Reply Last reply
                  0
                  • N niceguyeddie1999

                    how do you do a put through IE?

                    I Offline
                    I Offline
                    Ista
                    wrote on last edited by
                    #9

                    ftp://ftp.microsoft.com/[^] Click Help-Index then type FTP ftp://ftp.microsoft.com:userName@password I believe. I usually user WS_FTP http://www.ipswitch.com/[^] 1 line of code equals many bugs. So don't write any!! -- modified at 9:14 Wednesday 25th January, 2006

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups