Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HTML Downloads since Foxpro
Message
De
16/11/1999 12:58:13
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00291424
Message ID:
00291535
Vues:
14
I'm not sure how to get around this using the ITC.

You can do all of this stuff yourself using the InternetOpen, InternetOpenURL, and InternetReadFile functions in WinInet.dll these are docuemented in MSDN and at MSDN online at: http://msdn.microsoft.com/workshop/networking/wininet/reference/reference.asp

The easiest alternative is to use Rick Strahl's wwIPStuff class, which encapsulates this functionality for you. your task will be as easy as writing a few lines of code:

oIP = CREATEOBJECT("wwIPstuff")
lcFile = oIP.HTTPGet("http://ftp.whatever.com/myfile.dbf")
=STRTOFILE(lcFile, "myfile.dbf")

You can get wwIPstuff here in the files section, or on Rick's website at www.west-wind.com.


>I receive this code from eric moore and this really work, but it have a limitation that consist that VFP has limited the maximun array elements number to 65,000.
>
>
>This mean that i cant download a file biger than 65,000 bytes, some alternative solution.
>
>Thanks and Regards
>
>>So, assuming a working URL, you can gte a binary file as a byte array like >this:
>>
>>
>>strURL = "http://SomeDomain.com/somebinaryfile.dbf"
>>
>>* Retrieve the file as a byte array.
>>
>>laFileArray = THISFORM.Inet.OpenURL(strURL, 1)
>>
>>lcFileString = ""
>>FOR i = 1 TO ALEN(laFileArray)
>> lcFileString = lcFileString + CHR(laFileArray[i])
>>ENDFOR
>>
>>STRTOFILE(lcFileString, "c:\SomeBinaryFile.dbf")
>>
>>
>>The variable that the function returns when you pass in 1 as the second parameter is actually a VFP array. Its values are numeric, and all oyuhave to do is translate them into their characters with CHR().
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform