[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Marinetti 'casper' - How do I use it?



  To: Steven Hirsch
The server doesn't know and has no reason to care if the data is to be written 
to disk or something else has to happen to it.  The typical client has to able 
to do the right thing to process a request:
* viewed by the browser (HTML, TXT. JPG/PNG/GIF/BMP image,  etc.).
* pass it to a plugin (flash, avi, etc).
* save to disk.

The server does have a table to translate filename extension to the 
appropriate MIME type (content type)--this is needed for all clients, but 
clients tend to also have a default contnet0type if one doesn't appear.  It is 
up the client to do the appropriate thing when it receives the content-type in 
the HTTP headers.

Clients usually handle the "save to disk" two ways:
1) The document provides an unsupported content-type to be handle by the 
viewer 
   or plugins
2. The user does something like right-click to download the link content.

The "save" doesn't require user interaction so it is impossible for the server 
to do anything special.

The filename is determined by the characters after the last "/" in the URL.

Geoff

 > glen herrmannsfeldt wrote:
 > > Steven Hirsch wrote:
 > 
 > > (snip about binary files and HTTP, I wrote)
 > 
 > >>> I know that I can transfer non-HTTP binary files using
 > >>> "save link target as" after right clicking on a link.
 > > 
 > >>> I haven't thought about why no HTTP headers are added before.
 > > 
 > >> D'oh...  Yes, now that I think about it all the client cares about is >> 
 > that the header has correctly provided the length in bytes.  From that >> 
 > point on, "it's all just data".  What I'm still not clear on is how a >> 
 > client browser "tells" the server that it's _sending_ binary 
 > >> information and expects it to end up in a file.
 > > 
 > > Usually it doesn't care about the length, but reads until the TCP 
 > > connection is closed.  There was some interest in transferring more
 > > than one page (file) on one TCP connection, but mostly that isn't done.
 > 
 > Yes, but how does the server "know" that the incoming data is to be written 
 > out as a file?  How does it get the file name?  I thought there was a 
 > defined protocol for this, but perhaps not.
 > --- Synchronet 3.14a-Win32 NewsLink 1.85
--- Synchronet 3.14a-Win32 NewsLink 1.85
A2Central.com - Your total source for Apple II computing.