"Fred Pacquier" <[EMAIL PROTECTED]> wrote:
> What I'm trying to do is a simplified download manager of sorts - 
> based on the WebKit Admin pages examples. Think of a list of files 
> (on the server) with checkboxes (like the page where you reload 
> modules in Admin), protected by a SecurePage login. I'd like the 
> user to be able to tick off a few files, press the "download" button, 
> and have the corresponding "Save as..." dialog(s) open in her 
> browser.

I'm not sure how you'd download several files at a time, but doing one
file is fairly easy -- if you want, you could zip several files and
download the zip file to the user.

To download the files, you want a MIME type that the web browser can't
display.  Set the header

  Content-type: application/octet-stream

which means random sequence of bytes, basically.  application/zip for
zips, application/gzip for gzip, etc., would also work well.

To actually download the file you can simply open the file and write
it, e.g.:

    f = open(filename)
    self.write(f.read())
    f.close()

  Ian

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to