Tuesday, August 16, 2011

httpresponse creates file in /tmp

Hi,

currently I'm working on an application that serves PDF files using
HttpResponse:

f = open( pdfFileName, 'r' )

response = http.HttpResponse( f.read(), mimetype='application/
pdf' )
response['Content-Disposition'] = 'attachment; filename=%s' %
pdfFileName

f.close()

return response

Problem is that HttpResponse creates the served file in /tmp which is
not desirable.

Anyone have a suggestion?

PS: I've also tried with StringIO, same result.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate