> I want to upload a zip file to an FTP server.
> I tried to use FTP_Class by Robert Abram (Universal Thread).
> What I want to ask is that when I execute the supplied code, Windows XP Block Application message appears. Can I stop this message, or is there a workaround to upload a zip file without user interaction.
>
> Thanks in advance.
Hi Zaheer,
Another option is to use the Microsoft command-line FTP client.
You could have an FTPAUTOWEB.BAT file with a single line as follows:
ftp -s:FTPAUTOWEB.TXT
The text file would contain something like:
open ftp.myserver.com.au
russellhill
ab554527
cd testing
lcd c:\zip
put MyZipFile.ZIP
quit
where the lines from above are, in order:
logon using the host name
user name
password
change the FTP directory to "testing"
change the local directory to "c:\zip"
upload the zip file to "testing" on the server
logoff
You could call the BAT file using ShellExecute from a CommandButton.Click(), for example, as follows:
Local cFileToExecute, cDirectory, cParameters, cOperation, nShowWindow, nError
DECLARE INTEGER ShellExecute ;
IN SHELL32.DLL ;
INTEGER nWinHandle, ;
STRING cOperation, ;
STRING cFileName, ;
STRING cParameters, ;
STRING cDirectory, ;
INTEGER nShowWindow
cFileToExecute = 'FTPAUTOWEB.BAT'
cDirectory = 'c:\zip'
cParameters = []
cOperation = 'open'
nShowWindow = 3
nError = ShellExecute( 0, ;
m.cOperation,m.cFileToExecute,m.cParameters,m.cDirectory,m.nShowWindow ;
)
MESSAGEBOX("This is an FTP test .... Wait for the DOS window to close and then click to exit.")
You can get a full list of the command-line options from:
http://www.nsftools.com/tips/MSFTP.htmHope this helps.
Regards,
Russell.