Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XmlHttp for JPEG?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
01236450
Message ID:
01236482
Vues:
12
>I have a remote web server that sends a binary JPEG, and I would like to use XmlHttp object to capture the output and display it as a JPEG. How can I do that?
>
>Thanks.

Something like this should work:
o = CreateObject("Microsoft.XMLHTTP")
o.open("GET", "http://www.websiteaddress.com/imagename.JPG")
o.send("")
* Need to add code here which checks readyState, and handles timeouts, errors, etc.
STRTOFILE(o.responseBody, "C:\Image.JPG")
Take a look at the readyState property; maybe a loop which checks to see if it's set to 4 (I believe), if not, keep waiting until you hit some preset count (so you don't end up in a closed loop).

You'll probably also want to check to make sure things like the status property = 200 (successful).
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform