Mailing List Archive

HTTP
Hi,

If a client asked an HTTP 1.0 server to send it a jpeg file, then does
the server send it as it is, or does the server perform some encoding
on the file and then send the encoded data? If so what kind of
encoding is it? I continue to remain unsure despite having read the
RFC.

Thanks,

--
Hareesh Nagarajan
WEB: http://puggy.symonds.net/~hareesh

--
gentoo-user@gentoo.org mailing list
Re: HTTP [ In reply to ]
On Tuesday 12 October 2004 10:31 am, Hareesh Nagarajan wrote:
> Hi,
>
> If a client asked an HTTP 1.0 server to send it a jpeg file, then does
> the server send it as it is, or does the server perform some encoding
> on the file and then send the encoded data? If so what kind of
> encoding is it? I continue to remain unsure despite having read the
> RFC.

a jpeg is a *binary* file, encodings are performed on text files, not binary.

regards,
Christian Parpart.

--
Netiquette: http://www.ietf.org/rfc/rfc1855.txt
11:05:28 up 48 days, 22:45, 1 user, load average: 0.01, 0.12, 0.12
Re: HTTP [ In reply to ]
>>If a client asked an HTTP 1.0 server to send it a jpeg file, then does
>>the server send it as it is, or does the server perform some encoding
>>on the file and then send the encoded data? If so what kind of
>>encoding is it? I continue to remain unsure despite having read the
>>RFC.
>
>
> a jpeg is a *binary* file, encodings are performed on text files, not binary.

True, jpegs are binary, but HTTP is a text protocol, so binaries are
encoded into MIME, which is text. Try telnetting to port 80 and issuing
"GET / HTTP/1.0" (then hit return twice). Or maybe "GET /someimage.jpg
HTTP/1.0" and see what pops out.

Rgs,
Adam


--
gentoo-user@gentoo.org mailing list
Re: HTTP [ In reply to ]
> True, jpegs are binary, but HTTP is a text protocol, so binaries are
> encoded into MIME, which is text. Try telnetting to port 80 and issuing
> "GET / HTTP/1.0" (then hit return twice). Or maybe "GET /someimage.jpg
> HTTP/1.0" and see what pops out.

I tried to get that Yahoo! Logo which is in GIF. There appears to be
no encoding. When is base64 encoding used in HTTP/1.0?

IMAGE: http://us.i1.yimg.com/us.yimg.com/i/ww/m6v8c.gif

<telnet>
hareesh: 1/ $ telnet us.i1.yimg.com 80
Trying 69.225.175.73...
Connected to us.i1.yimg.com.
Escape character is '^]'.
GET /us.yimg.com/i/ww/m6v8c.gif HTTP/1.0

HTTP/1.0 200 OK
Content-Type: image/gif
Content-Length: 7875
Last-Modified: Fri, 15 Apr 1994 00:00:00 GMT
Date: Tue, 12 Oct 2004 14:47:12 GMT
Connection: close
Expires: Thu, 15 Apr 2010 20:00:00 GMT

GIF89....binary data.....
</telnet>

Thanks,
--
Hareesh Nagarajan
WEB: http://puggy.symonds.net/~hareesh

--
gentoo-user@gentoo.org mailing list
Re: HTTP [ In reply to ]
Adam Carter wrote:

> True, jpegs are binary, but HTTP is a text protocol, so binaries are
> encoded into MIME, which is text. Try telnetting to port 80 and issuing
> "GET / HTTP/1.0" (then hit return twice). Or maybe "GET /someimage.jpg
> HTTP/1.0" and see what pops out.

MIME is a way to send data across a data path which might not understand
binary data. However, that doesn't mean you *have* to encode the data.
encoding can be "none", and normally is under HTTP. The http server will
tag the data with a mime-type, so the receiving application has a clue
what to do with the data once it gets it... unless you use IE in which
case it ignores mime-type and just uses the extension.

--
gentoo-user@gentoo.org mailing list
Re: HTTP [ In reply to ]
Billy wrote:
> The http server will
> tag the data with a mime-type, so the receiving application has a clue
> what to do with the data once it gets it... unless you use IE in which
> case it ignores mime-type and just uses the extension.

During my web-design days I had an account on one of those
free-hosting-but-insert-add web sites which modified your html. Do get
over that I renamed all the .html files to .jpg and uploaded onto the
server. IIRC IE could display just fine the web page. So it can't ignore
the mime-type.


--

Adi

--
gentoo-user@gentoo.org mailing list
Re: HTTP [ In reply to ]
On Tue, 12 Oct 2004 18:16:56 +0300, Adrian CAPDEFIER
<adriancapdefier@digifin.ro> wrote:
> During my web-design days I had an account on one of those
> free-hosting-but-insert-add web sites which modified your html. Do get
> over that I renamed all the .html files to .jpg and uploaded onto the
> server. IIRC IE could display just fine the web page. So it can't ignore
> the mime-type.

IE used to use a rather complicated process to work out the content
type of a file was. The file extension and sniffing the data itself
were involved. I believe the XP SP2 disabled all that sniffing.

--
David Dorward <http://dorward.me.uk><http://blog.dorward.me.uk>

--
gentoo-user@gentoo.org mailing list
Re: HTTP [ In reply to ]
Adrian CAPDEFIER wrote:

> During my web-design days I had an account on one of those
> free-hosting-but-insert-add web sites which modified your html. Do get
> over that I renamed all the .html files to .jpg and uploaded onto the
> server. IIRC IE could display just fine the web page. So it can't ignore
> the mime-type.

I could have sworn I've seen IE ignore mime types, but you're right. I
made a web script to test it, and sure enough, IE will happily open a
jpeg file as an application/msword document, and it will try as hard as
it can to display a real word document as an image/jpeg.


--
gentoo-user@gentoo.org mailing list
Re: HTTP [ In reply to ]
On 12 Oct 2004, at 03:29, Adam Carter wrote:
>>> If a client asked an HTTP 1.0 server to send it a jpeg file, then
>>> does
>>> the server send it as it is, or does the server perform some encoding
>>> on the file and then send the encoded data? If so what kind of
>>> encoding is it? I continue to remain unsure despite having read the
>>> RFC.
>> a jpeg is a *binary* file, encodings are performed on text files, not
>> binary.
>
> True, jpegs are binary, but HTTP is a text protocol, so binaries are
> encoded into MIME, which is text. Try telnetting to port 80 and
> issuing "GET / HTTP/1.0" (then hit return twice). Or maybe "GET
> /someimage.jpg HTTP/1.0" and see what pops out.

False. Binary data transferred over HTTP are not encoded in any fashion.