Solved

Parse web images from HTTP

Posted on 2003-11-20
5
227 Views
Last Modified: 2010-04-05
Hi,

I'm trying to load jpg images from a web server.
I have succeeded to send the GET command to the
web server, and after that I get these lines:

..
..
Content-type: image/jpg
Content-length: 26232

(... binaries....)

I'm trying to save/parse the binaries to a jpg file
but I do not know how, can anyone help me?

It is important that I program on this level, and
not on higher level by using a web image component
because I in the future I have to parse streaming
images through the web.

regards,
huferry
0
Comment
Question by:huferry
  • 3
5 Comments
 
LVL 1

Expert Comment

by:User137
Comment Utility
Would this component be handy? It can download any files silently from internet, it's free and source included. At least it may have something to learn from...
HTTPGet at: http://www.utilmind.com/
0
 
LVL 3

Accepted Solution

by:
JDuncan earned 50 total points
Comment Utility
Are you using any components to access the web, to do what you want using indy its as simple as

        ASource:=TFilestream.Create(myFile,fmCreate+fmShareCompat);
        Get('http://mySite/myURL,ASource);
        ASource.Free;
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
Apparently he is using WinInet functions. I have no idea how to do that using WinInet.
0
 
LVL 3

Expert Comment

by:JDuncan
Comment Utility
To use wininet to download files from the net use the function

InternetReadFile(handle,addr(buffer),sizeof(buffer),BytesRead);

Where handle is returned by InternetOpenUrl function.

You decide how many bytes to read at atime by setting the buffer size.
and you can write the buffer to a file or filestream , maybe directly to the jpeg stream
0
 
LVL 3

Expert Comment

by:JDuncan
Comment Utility

I worked on this question some time ago , it has code for uploading downloading files via wininet.


http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20763209.html#9765274
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now