Hello Everyone,
Can someone provide sample code that makes http request and that request returns a JPG image that I need to save on local HD?
Thank you,
Http call returns image
Re: Http call returns image
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- Antonio Linares
- Site Admin
- Posts: 42256
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Http call returns image
If the URL refers to a jpg image like this
"https://cdn.images.express.co.uk/img/dynamic/109/590x/Apple-links-587431.jpg"
We can save the jpg with just one function like this in one single line of code:
Note: The function WebpageContents( cUrl ) uses oHttp for reading the contents of any web-page
"https://cdn.images.express.co.uk/img/dynamic/109/590x/Apple-links-587431.jpg"
We can save the jpg with just one function like this in one single line of code:
Code: Select all | Expand
cURL := "https://cdn.images.express.co.uk/img/dynamic/109/590x/Apple-links-587431.jpg"
MEMOWRIT( "myfile.jpg", WebPageContents( cURL ) ) // This one line of code does the job
// Check if saved correctly
XIMAGE( "myfile.jpg" )
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India