Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Parse web images from HTTP

Posted on 2003-11-20
5
230 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
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…

860 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