Solved

Parse web images from HTTP

Posted on 2003-11-20
5
233 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
[X]
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
  • 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 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