Forum Moderators: phranque

Message Too Old, No Replies

Error: Document contains no Data with SPYCE-ContentType Problem?

How to set ContentType correctly?

         

yuppie

9:30 pm on May 26, 2005 (gmt 0)



Hello,
I have a problem which I cannot solve. I wrote a Server application with SPYCE (Python Server Pages) which produces after successful work a "Page cannot be found" error in Internet Explorer and a "Document contains no Data" in Mozilla Firefox.

Here are the last lines where a created PDF Document will be sent to the client. Is there something wrong with ContentType setting?

contentType = 'application/pdf'
response.setContentType(contentType)
response.addHeader('Content-Disposition', 'attachment; filename=%s' %shortname + extension)
raise spyceDone