Joe Strazzere - All Things Quality

Visit my new blog at http://strazzere.blogspot.com/


December 1, 2005 - WinTask - FTPPut

Posted in WinTask

'
' FTPPut - FTP a file to a remote folder
'
' Author - "denethor" from the WinTask Forum
'

 

Sub FtpPut(FtpSite$,FtpPort,FtpUser$,FtpPass$,RemoteDir$,LocalFile$,RemoteFile$)
  FtpTranType = 2
  InetServiceFtp = 1
  InetFlag = 0
  InetOpenType = 0
  ConName$="FTPBOT"

 

' Open an internet connection
  InternetOpen=External("wininet.dll","InternetOpenA", ConName$, 0, "", "", 0)

' Connect to the FTP server
  InternetConnect=External("wininet.dll","InternetConnectA", InternetOpen, FtpSite$, FtpPort, FtpUser$, FtpPass$, 1, InetFlag, 0)

' Set the current directory on the FTP server
  FtpSetCurrentDirectory=External("wininet.dll","FtpSetCurrentDirectoryA", InternetConnect, RemoteDir$)

' Upload the file
  FtpPutFile=External("wininet.dll","FtpPutFileA", InternetConnect, LocalFile$, RemoteFile$, FtpTranType)

' Close FTP site connection
  InternetCloseHandle=External("wininet.dll", "InternetCloseHandle", InternetConnect)

' Close the internet connection
  InternetCloseHandle=External("wininet.dll", "InternetCloseHandle", InternetOpen)      
EndSub

 

FtpPut("FtpSite",21,"FtpUser","FtpPassword","FtpDir","c:\YourDir\YourFile.ext","YourFile.ext")


<- Last Page :: Next Page ->

About Me

A gathering place for information and ideas about Quality Assurance, Testing, and other useful topics.

Problems cannot be solved by the same level of thinking that created them. - A. Einstein

Search This Site

Translate This Site

RSS Feed

Subscribe

Twitter

@jstrazzere

Categories

Life
QA
Sports
Tools
WinTask
Work in General

What I'm Reading Now