~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/apps/download/__init__.py

  • Committer: mattgiuca
  • Date: 2008-02-03 12:55:46 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:390
Added automatic unzipping on file upload.
browser/listing.js: Added a checkbox to the upload panel for unzipping.
Fileservice: If this box is checked, and a zip file is found (ending in
".zip"; there is a comment here to change that to looking at the file's magic
number), it will attempt to unzip it into the current directory.
zip.py: Added unzip method. Also changed "make_zip" to not take a req argument
    (not needed).
download: Do not pass req to zip.make_zip.

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
        req.headers_out["Content-Disposition"] = ("attachment; filename=" +
100
100
            zipfilename)
101
101
        zipfile = StringIO.StringIO()
102
 
        zip.make_zip(zipbasepath, paths, zipfile,req)
 
102
        zip.make_zip(zipbasepath, paths, zipfile)
103
103
        req.write(zipfile.getvalue())
104
104
    else:
105
105
        req.content_type = default_mimetype