Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Russell Hill
  Where is Russell Hill?
 Sydney
 Australia
 Russell Hill
 To: Zaheer Ahmed
  Where is Zaheer Ahmed?
 Peshawar
 Pakistan
 Zaheer Ahmed
 Tags
Subject: RE: FTP using VFP
Thread ID: 249737 Message ID: 249885 # Views: 48 # Ratings: 2
Version: Visual FoxPro 9 Category: Web, FTP and other Internet Protocols
Date: Sunday, January 10, 2010 12:10:18 PM         
   


> 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.htm

Hope this helps.

Regards,

Russell.




COMPLETE THREAD

Tip: click here to scan for Windows Registry Errors and Optimize PC performance
FTP using VFP Posted by Zaheer Ahmed @ 1/8/2010 11:52:28 AM
RE: FTP using VFP Posted by Martina Jindrová @ 1/8/2010 1:15:35 PM
RE: FTP using VFP Posted by Zaheer Ahmed @ 1/8/2010 1:18:30 PM
RE: FTP using VFP Posted by Stefan Wuebbe @ 1/8/2010 1:19:28 PM
RE: FTP using VFP Posted by Zaheer Ahmed @ 1/9/2010 5:38:40 AM
RE: FTP using VFP Posted by Stefan Wuebbe @ 1/9/2010 10:35:30 AM
RE: FTP using VFP Posted by Zaheer Ahmed @ 1/11/2010 6:51:19 AM
RE: FTP using VFP Posted by Russell Hill @ 1/10/2010 12:10:18 PM
RE: FTP using VFP Posted by Zaheer Ahmed @ 1/11/2010 6:52:37 AM