Solved

Parse web images from HTTP

Posted on 2003-11-20
5
228 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
ID: 9789059
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
ID: 9798012
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
ID: 9800588
Apparently he is using WinInet functions. I have no idea how to do that using WinInet.
0
 
LVL 3

Expert Comment

by:JDuncan
ID: 9803383
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
ID: 9803460

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Best Firemonkey component pack 1 101
Working this component WebCopy with proxy, help 3 84
Base1 Encode/Decode 3 77
Firemonkey webbrowser scrollbars ? 1 38
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

786 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