[Zope] retrieving a blob stored file from mysql
Aaron Kunkle
aaronkunkle at earthlink.net
Thu Oct 2 18:28:50 EDT 2003
I am trying to implement a feature on my site where users can upload a
file (typically a tif file) for other users to download. I have the
upload working fine and the download side works with Linux with Mozilla
(my development system) but IE6 won't open the file as if it were a
regular link. When you choose "save as" it works but if you choose
"open with" to open the file with some kind of image viewer Windows
complains that the temporary file does not exist.
This is what I'm doing:
1. I link to my python script from my dtml document
<a
href="get_attachment?attachment_id=&dtml-attachment_id;">&dtml-doc_name;</a>
2. get_attachment
result = context.sqlSelAttachmentByID(attachment_id = attachment_id)
container.REQUEST.RESPONSE.setHeader('content-type', result[0].type)
container.REQUEST.RESPONSE.setHeader('content-disposition',
'attachment;filename=' + result[0].doc_name)
#content-disposition can use either: application, inline, or attachment
return result[0].attachment
I've tried using all 3 of those content-disposition settings with the
same results.
Does anyone know what I'm doing wrong?
Thanks,
Aaron Kunkle
More information about the Zope
mailing list