Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 transfer files to ftp

Author  Topic 

inbs
Aged Yak Warrior

860 Posts

Posted - 2008-12-16 : 01:25:34
hello

how can i transfer files from my local server to ftp server?
(how can i use it in vbscript?)

i wrote in job (step in type CmdExec)

ftp open 192.110.177.23
user almonni
password 1234
put D:\FILES

but it faild,what is the solution?

(how i do it in vbscript?)

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-16 : 01:32:03
http://www.robvanderwoude.com/ftp.html
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2008-12-16 : 01:46:36
hi visakh16,how are you?

i read it but i dont understand how to translate it .

how can i wrote it in one command?(i suppose that is the solution)

thanks visakh16
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2008-12-16 : 01:57:02
now i wtite this

ftp
open 192.110.177.23
user almonni
password 1234
put D:\FILES\aa.text
quit

the job run but not stop,aa.text is just 2KB,what is the problem?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-16 : 02:00:33
quote:
Originally posted by inbs

hi visakh16,how are you?

i read it but i dont understand how to translate it .

how can i wrote it in one command?(i suppose that is the solution)

thanks visakh16


I'm fine thanks
see this also
http://www.nigelrivett.net/FTP/s_ftp_PutFile.html


Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2008-12-16 : 02:01:59
i thinks the problem in the job(sql 2000) i wrote just:

ftp
quit

and it run and not stop.
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2008-12-16 : 02:07:38
quote:
Originally posted by visakh16

quote:
Originally posted by inbs

hi visakh16,how are you?

i read it but i dont understand how to translate it .

how can i wrote it in one command?(i suppose that is the solution)

thanks visakh16


I'm fine thanks
see this also
http://www.nigelrivett.net/FTP/s_ftp_PutFile.html






should be so difficult,i dont understand the code.
i dont know where to start :-)
explain me how to do it?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-16 : 02:16:08
its same as what i posted in first link. second just automates process into a procedure. you just need to call procedure from job and then pass appropriate values for parameters.
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2008-12-16 : 02:43:59
how can i write this in VBScript?

ftp open 192.110.177.23
user almonni
password 1234
put D:\FILES
(put all files in D:\FILES\ to FTP SERVER)

thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-16 : 03:18:58
here's a vbscript code which automates ftp

http://www.sqlservercentral.com/articles/Administering/usingvbscripttoautomatetasks/1171/
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2008-12-16 : 04:28:35
"The following example demonstrate a technique to get a file via FTP"

i know how to get files from ftp, i dont know how to put files in the ftp

and this is the problem how to move/transfer files from my server to ftp server via vbscript?

thanks
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2008-12-16 : 05:17:15
i wrote this,maybe you have solution for me?

i have a little progress,one problem is how i can to tell objFTP to point to spechipic Folder?

he dont like this objFTP.GetFolder("DesFolder\") ' + file.name

Function Main()

Dim objFTP 'As ChilkatFTP 'test

Set objFTP = CreateObject("ChilkatFTP.ChilkatFTP.1") 'test
Set fso = CreateObject("Scripting.FileSystemObject")

' pass the connection properties to the object

objFTP.Username = "SUP"
objFTP.Password = "1234"
objFTP.HostName = "192.154.198.20"

objFTP.Connect()

Set f = fso.GetFolder("D:\FILES\")
For Each file In f.Files
fso.copyfile "D:\FILES\" + file.Name, objFTP.GetFolder("DesFolder\") ' + file.name
Next

Set objFTP = Nothing

Main = DTSTaskExecResult_Success
End Function




Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2008-12-16 : 07:37:15
ok,i succeed
Go to Top of Page
   

- Advertisement -