Real'sHowTo AddThis Feed Button
Custom Search

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

blog comments powered by Disqus


If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2014
[ home ]