Sorry for the delays everyone, I was away from this here IMAP4
server for a while... :)
Chuck says :
> If you're in a subclass of Page, you are probably getting it from that.
> Page as writeHTML() which cascades into various methods. You might take a
> moment to study Page.py, its writeHTML() methods and the ones that follow
> for your general WebKit education.
> If your form submission button is tied to an action, then I think you could
> implement preAction() and postAction() to do pass and thereby not inherit
> any garbage.
> Or you could subclass HTTPServlet.
> Or possibly detect the action in awake(), forward to a subclass of
> HTTPServlet() (see Application.forwardURL()) and then refrain from
> generating any more content in the original servlet.
(...) > Or maybe you can do some fancy JavaScript that would iterate over the files >
and open a new connection for each one. I think that's feasible, but it
> obviously requires some experimentation and work.
Thanks for all the hints Chuck... they'll probably come in handy
someday, although most are above my understanding of Webkit
right now, and probably more than warranted by my simple-minded
app anyway... but then you said : > Finally, you might consider
providing the user FTP links.
Funny you should mention that. Avoiding FTP was, for various
reasons, the main motivation for trying to implement my first
Webware micro-app in the first place... OTOH, during the time
between hitting the wall and getting the first answers from the list, I
realized I was having a bad case of "looking for nails because I had
a hammer in my hands" :-) Specifically, because I was working
from the Admin pages examples, I was trying to modify the "App
control" form to push download files from a directory listing. This
turns out to be both
complicated and unnecessary : I've now jettisoned the form code,
and now list the files as plain HTML links (HREFs). Lo and behold,
Webkit now automagically takes care of downloading :-)
The only downside is that I lose some flexibility on file placement
(they need to be in some subdirectory of my Webkit servlet, instead
of anywhere at all, unless I've missed something again...), but I can
live with that for this particular usage. And it works right now :)
> WebKit (in CVS) already has streaming responses (thanks Jay) so most of the
> work is already done for you. The problem you are experiencing now is that
> the read() method on a file reads the whole file.
> I think you can pass read() a max number of bytes, right? Something like:
> bufferSize = 10*1024
> ...
> chunk = file.read(bufferSize)
> res.write(chunk)
> You need to loop through, exit on EOF or IOError, etc.
Yes, I'd tried that, as demonstrated in the pythin lib "shutil" module -
didn't seem to make a difference (see later in the thread).
BTW, speaking of CVS, when is the next non-CVS "release" due ? :)
> You're not pestering at all. These are all great topics for the discussion
> list.
Thanks. I've been following the Web archive for a while before
diving in, and this is a welcoming, tolerant place - although most of
the proceedings is way over my head :-)
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/webware-discuss