******************************************************************** * Description.......: DownloadFile * Calling Samples...: DownloadFile("http://www.mywebsite.com/myfile.txt","c:\temp\myfile.txt") * Parameter List....: tcURLFile, tcLocalFile * Created by........: Ramon F. Jaquez * Modified by.......: Nadya Nosonovsky 10/09/2002 09:50:50 AM ******************************************************************** lparameters tcURLFile, tcLocalFile if vartype(m.tcURLFile)<>"C" tcURLFile = InputBox('Enter URL for file for Download','URL',space(200)) if empty(m.tcURLFile) return .f. endif endif if vartype(m.tcLocalFile)<>"C" tcLocalFile = InputBox('Enter local name of the file','Local file',space(200)) if empty(m.tcLocalFile) return .f. endif endif LOCAL nResult DECLARE LONG URLDownloadToFile IN URLMON.DLL ; LONG, STRING, STRING, LONG, LONG *!* cURL = "http://www.mywebsite.com/myfile.txt" *!* cFile = "c:\temp\myfile.txt" wait window nowait 'Wait while downloading the file...' nResult = URLDownloadToFile(0, m.tcURLFile, m.tcLocalFile, 0, 0) wait clear if m.nResult <> 0 && OK =messagebox('Download failed!',48,'Failure') endif return m.nResult = 0>This is one way to do this...
> >LOCAL cFile, nResults, cURL > >DECLARE LONG URLDownloadToFile IN URLMON.DLL ; > LONG, STRING, STRING, LONG, LONG > >cURL = "http://www.mywebsite.com/myfile.txt" >cFile = "c:\temp\myfile.txt" > >nResults = URLDownloadToFile(0, cURL, cFile, 0, 0) > >If nResult = 0 && OK > >>