[Zope] Returning a zip file (downloaded by user)??
Tue, 30 Jul 2002 22:41:43 +0200
These headers are set by an app I worked on (although I didn't do
the zipfile-download-thingy myself). Hope these work for you too...
filename=%s' % the_name_of_the_file)
Another difference: the download method in aformentioned app does
not "REQUEST.RESPONSE.write(data)", but just "returns" the data,
after setting the headers.
On Tuesday, July 30, 2002, at 10:01 , Aseem Mohanty wrote:
> I have a zip file that I create on the fly which is to be returned
> to the user. The process goes like this:
> 1. User clicks on a link.
> 2. External method creates a zip file and puts it in a temp folder
> ( file system folder not Zope temp)
> 3. External method (same one) returns the zip file as part of
> response as type application/x-zip
> The following is what I do in to get it done:(part 3 i.e.)
> zip_size = stat(zip_file_name).st_size
> zip_file = open(zip_file_name)
> zip_data = zip_file.read()
> but when I try it out the following happens:
> - the zip file is created
> - zip_data has the data (of course)
> - i am prompted to download something of type
> - if i save the file it has zero length
> so what am I doing wrong or not doing here, that needs to be done
> to get this right??
> -- ==================================================================
> Aseem Mohanty Neurobehavioral Systems
> Inc, 828 San Pablo Ave, Albany, CA 94706 (R) 510 7696011 (M) 510
> 3014871 (O) 510 5279231
> "I saw `cout' being shifted "Hello world" times to the left and
> stopped right there!!" -- Steve
> Gonedes ================================================================
> Zope maillist - Zope@zope.org
> ** No cross posts or HTML encoding! **
> (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )