program to copy files to ftp backup server

sdlangers

Well-known member
Joined
Dec 3, 2002
Messages
118
hi,

my dedicated server has a backup server which i can copy files to using these steps:

i have to open up IE and type in this url:

ftp://myuser@mybackupserver.com/

it then prompts me for the password which i enter, then i can simply drag the files into that window and it copies them over

however, i would like to write a .net program to copy some files over automatically and then schedule it to run nightly

can someone point me in the right direction for trying to code the above procedure. how do you specify the ftp site as the destination, how do you specify the user/pass etc.

thanks!
 
I dont suppose the servers are on the same LAN and you could map a network drive. And you just use FTP for convenience? If so, you could write a batch file and schedule a task. Like this

Code:
@echo off
copy "C:\MyFile.ext" "D:\ACopyofMyFile.ext"
copy "C:\My2ndFile.ext" "D:\ACopyofMy2ndFile.ext"


Otherwise check out the links ilya2 posted at the end of this thread http://www.computerhelp.forum/showthread.php?t=92744 you should be able to pick up some 411 there.
 
Nate Bross said:
I dont suppose the servers are on the same LAN and you could map a network drive. And you just use FTP for convenience? If so, you could write a batch file and schedule a task. Like this

Code:
@echo off
copy "C:\MyFile.ext" "D:\ACopyofMyFile.ext"
copy "C:\My2ndFile.ext" "D:\ACopyofMy2ndFile.ext"


Otherwise check out the links ilya2 posted at the end of this thread http://www.computerhelp.forum/showthread.php?t=92744 you should be able to pick up some 411 there.

Hi, thanks for the reply..

i wish it was that simple :)

the ftp drive cannot be mapped as a network drive, so i cant just use a drive letter.

i also tried that link you sent - the FTPClient in C# is a great program, but i cant get it to work for me.. problem is they use this line of code to connect:

aCN.Open("192.168.4.67", "anonymous", "", FTPMode.Active);

but i have to use the following syntax via a web-browser to connect:

"ftp://username@backupserver.com"

then it prompts me for the password, which i type in, and then i can connect

this is the ONLY way i can connect - i cannot even connect from regular FTP software. it HAS to be from within the browser on my dedicated server.. i cant even connect this way from any other computer.

anybody got any ideas on how to code this?
 
oh.. nevermind - i got that FTPClient C# dll working

i just needed to use the IP address instead of the FTP://username@server.com syntax

so i did a ping to the server, from my dedicated server to get the ip, then switched the code to use that and it worked

thanks for the help

ps - if anyone else is looking for something similar - i definitely recommend the FTPClient DLL - great program:

http://sourceforge.net/projects/dotnetftpclient/
 
Back
Top