Hay guys, how the hell do HTML/HTTP/Browsers really work? See, i have this one piece of code running, which when you connect to it will return some html code. So you see some nice pretty plain text, yay.
I do however want it to be able to return images, <IMG SRC...> does not work. As it only bounce back strings of text it fail no matter what i try with that approach. So what should i really return to get an image to display? There have to be some way to toss information to the recepient so that the browser generate a fucking image at the recepients end.
Language i use is ruby(in before rails or eruby) if that helps any.
Name:
Anonymous2007-02-12 18:16
I'm not sure what you're asking. What do you mean "bounce back strings of text"?
All images are encoded and sent back as blocks of 7-bit text attached to text HTTP headers.
while working perfectly in a .html file, doesn't work for this program, and i have no clues of how to make it work either, it/I simply don't know how to locate lulzz.jpg and no matter what kind of directions i try to add it still won't find it.
Name:
Anonymous2007-02-12 18:42
>>5
read http rfcs & use something like a cgi lib or what ever; anyways, you're an idiot for even writing your own http server or whatever you're trying to achieve if you can't deal with sending an image.
Name:
Anonymous2007-02-12 18:54
>>1
Uh, maybe you've misunderstood how the process works. I'm still not sure what you're asking:
First the browser requests the HTML. It gets the HTML back. It parses the HTML for associated resources it should download (CSS and images normally). Then it individually requests each resource.
So when you request the HTML, all you get back is the HTML. It's up to you to go through the HTML on the client side and requests the images that are referred to in the HTML.
If you already know this, I'm afraid you'll have to rewrite what you're doing.
Name:
Anonymous2007-02-12 19:07
feels like my head is full of cotton right now, but i guess i've misunderstood how things work.
So my little program do
"session.print <IMG SRC="lulzz.jpg" ALT="some text">"
and when the client get this it request the server for lulzz.jpg. So i have to put together some code which upon request for lulzz.jpg will send the image to client in correct format and so on instead of trying to forcefeed the client said image.
JUST FUCKING DELIVER WHAT THE CLIENT ASKS FOR
IF IT WANTS THE HTTP GIVE IT THE FUCKIGN HTTP
IF IT WANTS AN IMAGE GIVE IT THE IMAGE
DON'T FORGET YOUR FUCKING CONTENT-LENGTH HEADERS
ZOMG+RTFM+STFU+GTFO
Name:
Anonymous2009-01-14 13:19
SICP
Name:
Anonymous2009-03-06 5:57
The distance axis and multiple graphs of multiple days must be aggregated into one if needed to other c styled languages later.
Name:
Anonymous2009-03-06 7:20
Client in correct format and so on are all scripting and not programming.