Micro Focus QTP (UFT) Forums
How can we copy the text file to ftp server? - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How can we copy the text file to ftp server? (/Thread-How-can-we-copy-the-text-file-to-ftp-server)



How can we copy the text file to ftp server? - Anju Kansal - 02-10-2010

How can we copy the text file to ftp server?


RE: How can we copy the text file to ftp server? - jsknight1969 - 02-10-2010

You can create a text file with the ftp commands in order of execution...
http://support.microsoft.com/kb/96269

myftpcommands.txt
Code:
open ftp.mysite.com
user
password
hash
bin
put file1.txt
quit

Then you can call a shell execute command in QTP.
http://msdn.microsoft.com/en-us/library/bb774148(VS.85).aspx
Code:
dim objShell
set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "ftp.exe", "myftpcommands.txt", "", "open", 1
set objShell = nothing