D
Du Dang
I'm trying to learn how socket operates and I am successfully got
the server to reply, but now i don't know how to retreive the data, in this
case it's an image.
this is the header and follow it is an image
=================================
"HTTP/1.1 200 OK
Date: Tue, 16 Mar 2004 12:30:18 GMT
Server: Apache/1.3.28 (Unix) PHP/4.3.3
Last-Modified: Sat, 06 Mar 2004 01:01:09 GMT
ETag: "8f5a8a-4b2ea-404922d5"
Accept-Ranges: bytes
Content-Length: 307946
Keep-Alive: timeout=60, max=200
Connection: Keep-Alive
Content-Type: image/jpeg
"
<image content here>
=================================
I tried to use FileStream to write the image but I can't see the image after
it been downloaded and the size is inconsistant with the "Content-Length"
attribute.
buf[1024]
do {
size = socket.Receive(buf, buf.length, 0);
fs.write(buf, 0, buf.length);
}while (size > 0);
btw does "Content-length" includes the header size or is it just the data?
Any help is greatly appreciated !!!
Thanks,
Du
the server to reply, but now i don't know how to retreive the data, in this
case it's an image.
this is the header and follow it is an image
=================================
"HTTP/1.1 200 OK
Date: Tue, 16 Mar 2004 12:30:18 GMT
Server: Apache/1.3.28 (Unix) PHP/4.3.3
Last-Modified: Sat, 06 Mar 2004 01:01:09 GMT
ETag: "8f5a8a-4b2ea-404922d5"
Accept-Ranges: bytes
Content-Length: 307946
Keep-Alive: timeout=60, max=200
Connection: Keep-Alive
Content-Type: image/jpeg
"
<image content here>
=================================
I tried to use FileStream to write the image but I can't see the image after
it been downloaded and the size is inconsistant with the "Content-Length"
attribute.
buf[1024]
do {
size = socket.Receive(buf, buf.length, 0);
fs.write(buf, 0, buf.length);
}while (size > 0);
btw does "Content-length" includes the header size or is it just the data?
Any help is greatly appreciated !!!
Thanks,
Du