Skip to content Skip to sidebar Skip to footer

Displaying Uploaded File In Gae Appengine With Python

I have stored pdf files uploaded by users in the Datastore, as BlobProperties:
".

Look at encoding the content. Base64 works fairly well, but there are others. At very least you should escape the data there.

Solution 2:

The most basic way that this appears to be wrong is that:

<embedsrc="{{ person.pdf }}">

should contain the URL to download the pdf file. However, person.pdf actually contains the file data.

You'll need one handler to serve the html with the URL to the pdf data, and a separate handler to return the pdf data.

Solution 3:

I finally solved it by simply doing:

self.response.write(person.pdf)

in the display handler. D'oh.

Post a Comment for "Displaying Uploaded File In Gae Appengine With Python"