Results 1 to 6 of 6

Thread: FTP copy file to a folder (example: backup)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2015
    Posts
    23

    FTP copy file to a folder (example: backup)

    I'm having just a little trouble finding a secure method that is up to date and works with 2013 the way it was written. Just someone who knows a working guide or anything is perfect I just want to make a copy of file in a folder of my ftp site and move it to a subdirectory with a new name. Anything that talks specifically about that or anything that is at least useful for getting anything working with the FTP stuff (especially login) would be amazing

    Just in case it matters the file backup will probably be a database (.accdb) but it could be multiple types of files but the one I wanna concentrate on if it makes any difference is .accdb file type.
    Last edited by fatalerror0x00; May 23rd, 2015 at 06:31 PM. Reason: More information related to file types

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: FTP copy file to a folder (example: backup)

    Just to be clear, the file is already on the FTP server, right? You want to copy a file from one folder on the FTP server to another folder on the FTP server, right? Do you already know the basics of FTP in .NET, e.g. how to upload and download files, create folders, etc? There would be plenty of examples around of that sort of thing. You mention logging in as an issue, but that's pretty standard stuff. What have you tried and where did you encounter issues?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2015
    Posts
    23

    Re: FTP copy file to a folder (example: backup)

    Yes your correct. I have yet to ever do any FTP in any language ever. I just been looking around found some stuff that either does it in there own weird way or VS 2013 suggest something I"m not sure is the same and just examples seemed pretty far out of date. I'm trying a new search now though since I've taken a few days away and come back to this I'm a little more straight thinking. I'll let you all know if I find something but regardless anything you have still helps Thank you

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: FTP copy file to a folder (example: backup)

    You can perform basic FTP uploads and downloads using the My.Computer.Network object or the WebClient class. More complex operations can be performed using the FtpWebRequest class. When using the FtpWebRequest class, you set the Method property to the FTP command you want to execute. I believe that the only commands supported are those specified by the WebRequestMethods.Ftp class.

    As far as I can tell, there is no FTP command to copy a file. I can see commands to move a file, i.e. RNFR and RNTO, but not to copy. It may be that your only option is to download the existing file and then re-upload it. That seems strange but it appears to be so.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Junior Member
    Join Date
    May 2015
    Posts
    23

    Re: FTP copy file to a folder (example: backup)

    well anyway My.Computer.Network is insecure else I'd use that. WebClient class...Anything you can give on that because thats what I see but nothing seems to ever work out

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: FTP copy file to a folder (example: backup)

    Quote Originally Posted by fatalerror0x00 View Post
    well anyway My.Computer.Network is insecure else I'd use that. WebClient class...Anything you can give on that because thats what I see but nothing seems to ever work out
    If it doesn't work then you did it wrong. Instead of expecting us to write everything for you from start to finish, show us what you think it should be and tell us what actually happens. That way, we can help you fix your own code.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width