Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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!

Posted

I don't 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

 

@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.xtremedotnettalk.com/showthread.php?t=92744 you should be able to pick up some 411 there.

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

Posted
I don't 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

 

@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.xtremedotnettalk.com/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?

Posted

oh.. nevermind - i got that FTPClient C# dll working

 

i just needed to use the IP address instead of the http://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/

  • 4 years later...
Posted
How to restrict a unix ftp user to its home directory? I want to restrict one ftp user so that it cannot access any other directory on the server other than the home directory assigned to it. It should have full access to its home directory and all its sub-directories. Any help is greatly appreciated.
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...