Hi J,

Try saving the downloaded file and doing a byte-for-byte comparison with a
binary diff tool. You should be able to see what is being modified in your
response.

-Nick Johnson

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

>
> Acrobat comes back and says "The file is damaged and could not be
> repaired". If I skip the security checking and serve the file through
> a             self.redirect('downloads/filename.pdf'') Acrobat has no
> problem with it, that is how I conclude that the file itself is OK but
> the encoding is screwing things up.
>
> There has been another recent thread regarding downloading files where
> the core issue was IE. I have tested this in Firefox and Chrome so
> pretty sure it is not a browser issue.
>
> On Sep 25, 8:39 am, "Nick Johnson (Google)" <[email protected]>
> wrote:
> > 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
> >
>


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