I can't get GAE to send a file in pdf format. The code needs to verify
if the user has permissions and if so, send the file.

I thought perhaps encoding was the issue but base64 encoding the
content and declaring transfer encoding to be base64 doesn't work
either.

        ################
        # Permission validation succeeded
        ################
        self.response.headers['Content-Type'] = 'application/pdf'
        self.response.headers['Content-Transfer-Encoding'] = 'binary'
        self.response.headers['Content-disposition'] = 'attachment;
filename="filename.pdf"'
        path = os.path.join(os.path.dirname(__file__), 'downloads/
filename.pdf')
        infile = open(path,"r")
        inbuff = infile.read()
        self.response.out.write(inbuff)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to