Hi J,
Can you be more specific about what happens/doesn't happen?

-Nick Johnson

On Fri, Sep 25, 2009 at 1:35 PM, J <[email protected]> wrote:

>
> 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)
>
>
> >
>


-- 
Nick Johnson, Developer Programs Engineer, App Engine
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
368047

--~--~---------~--~----~------------~-------~--~----~
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