I'm uploading a small pdf file to be stored as a blob in the Datastore.
Here's the uploading html, getting the PDF from the user:
<form action="/" method="post" enctype="multipart/form-data">
<input type="file" name="pdf">
<input type="submit" value="Upload">
</form>
Here's the handler, storing the PDF to the Datastore:
def post(self):
p = self.request.POST['pdf']
if p:
person.pdf = p.value
Here's the view, showing the user the contents of the PDF:
<embed src="{{ person.pdf }}" width="500"
height="375" type="application/pdf">
According to all the information I have found, the content of the PDF should reside in p.value. However, the person.pdf attribute is None, and, of course, nothing is displayed.