durusmail: quixote-users: Strategies for returning file contents *and* HTML...
Strategies for returning file contents *and* HTML...
Strategies for returning file contents *and* HTML...
2004-03-12
2004-03-12
Strategies for returning file contents *and* HTML...
Nicola Larosa
2004-03-12
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> This (as you observed) isn't really a Quixote specific issue.  This would
> be somewhat tricky with any web solution I'm familiar with.

The Twisted Matrix web server, for one, is designed specifically to allow this
scenario. See the constant NOT_DONE_YET and the methods request.write and
request.finish .


> That said, some browsers can deal with documents being sent in a fragmented
> form that is spread out over time,

Had no problems using this tecnique with Mozilla, Konqueror, Lynx and Internet
Explorer. Of course, one cannot know in advance what the browser timeout is,
so don't stretch yourself too much. :^)


> but, a) Qx isn't put together in a way that would accomodate this easily,
> if at all (it requires that the server be able to send 'part' of a reply,
> then sit on it's thumbs for a time, then send some more, than sit on it's
> thumbs... etc until complete.  Qx is designed around the idea that the
> reply isn't sent until the whole reply is ready.

I can confirm that. A couple of years ago I asked how to do this with Quixote,
and remember vividly Neil answering that Quixote was not designed to do so,
and would not be modified accordingly. Check the archives.


> Further, I doubt you could change the content-type in the middle of the
> reply even with a browser that would honor this 'trick'.

As far as I know you cannot start sending an HTML page to the browser and then
another file in the same response. Never tried that, not going to. :^) You can
only "pause" or "stutter" the sending while the app puts together the data and
the page rendering, but only by appending HTML markup all the time.

You may instead try to use the "refresh" trick, but if you do not know in
advance how much time it wil take to retrieve the file, you will have to set
the refresh time to a few seconds. Then, each time the browser "checks
in", give it another page with the same short refresh, until the file is
finally ready and the browser gets it, at the same URL, at the next knock.


- --
Nicola Larosa - nico@tekNico.net

"Inside every old guy is a young guy wondering WTF happened."
 -- big-giant-head on Slashdot


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAUZfLXv0hgDImBm4RAvC1AJ4227Jr/Tmmm1j1t60zIfXd4tp+vACdFqcc
OO55O8+67FfxNr0oFONr9os=
=sLVv
-----END PGP SIGNATURE-----



reply