Share this page 

Upload a file using FTPTag(s): WinAPI/Registry


[DOS Batch file  upload.bat]
@rem This file will attempt to upload 1 files to the ftp server
@c:
@cd\temp
@echo open ftpserveripaddress >> t
@echo userid >> t
@echo password >> t
@echo binary >> t
@echo cd uploaddirectoryname >> t
@echo mput filenametobeuploaded  >> t
@echo bye >> t
@ftp -i -s:t
@del t

[PB external function declaration]
FUNCTION long ShellExecute (uint  ihwnd,string  lpszOp,string
   lpszFile,string  lpszParams, string  lpszDir,int  wShowCmd ) 
   LIBRARY "Shell32.dll" ALIAS FOR "ShellExecuteA" 


[PB ftp upload example]
string ls_parm, ls_dir
uint ll_ret
ls_parm = ""
ls_dir  =  "c:\path\"

ll_ret = ShellExecute &
    (handle(this),"open","upload.bat",ls_parm,ls_dir,0)
IF ll_ret < 32 THEN
     MessageBox( "cannot load" , ll_ret )
END IF