Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File download through VFP?
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00709121
Message ID:
00709252
Views:
20
Great. I just tried it:
downloadfile('http://www.levelextreme.com/wconnect/wc.dll?FournierTransformation~2,2,10002/oledbfox.zip','d:\OleDBFox.zip')

Is it possible to show progress while downloading?
********************************************************************
*  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
>
>
>
>>If I know the exact URL of a file (.EXE for example) is there a way to download it programmatically, without any human interaction (no Save As dialog, etc.)?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform