954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Reveive Image Bytes From HTTP Response Through Socket

Hi,

What command/technique is needed in a C program to receive image bytes through socket programming from an HTTP response? I want to develop a program that requests for an image from a server, then upon receiving the bytes comprising the image, it should write these bytes into a newly created file such that an image file is created. The image is of .jpg format. I really don't know how to create a program that receives and stores bytes through sockets so I hope someone here knows how to do it. So far, what I know is how to receive arrays of characters (strings) but now I want to know how to receive image bytes.

Also, the response my program is receiving has an HTTP header that comes before the actual image bytes so I need to remove the HTTP header first before writing the image bytes into a file. How do I do it? Thanks in advance. I'm working on a Windows XP machine.

shinsengumi
Junior Poster in Training
91 posts since Jul 2010
Reputation Points: 0
Solved Threads: 0
 

Hi,

What command/technique is needed in a C program to receive image bytes through socket programming from an HTTP response? I want to develop a program that requests for an image from a server, then upon receiving the bytes comprising the image, it should write these bytes into a newly created file such that an image file is created. The image is of .jpg format. I really don't know how to create a program that receives and stores bytes through sockets so I hope someone here knows how to do it. So far, what I know is how to receive arrays of characters (strings) but now I want to know how to receive image bytes.

Also, the response my program is receiving has an HTTP header that comes before the actual image bytes so I need to remove the HTTP header first before writing the image bytes into a file. How do I do it? Thanks in advance. I'm working on a Windows XP machine.


Ooops sorry for the repost, please remove the duplicate. Thanks and I apologize for this

shinsengumi
Junior Poster in Training
91 posts since Jul 2010
Reputation Points: 0
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: