I need to implement a rather simple web form on Google App Engine (GAE-Python) that accepts some form input (name, email, telephone) and a resume (typically TXT, PDF or DOC/DOCX) file. Once the form is submitted, I want to contents of the form to be emailed and if a file is submitted in the form, for it to be included as an attachment in the same email to a designated email address.
- I don't need the file to exist after it is emailed/attached. Sort of like a temp file, or stored in a temp blob store.
- With HTML5 and jQuery, there are lot of fancy user interfaces to implement file uploads. Is there any recommended approach to use one of these that work nicely with GAE, as well as being able to degrade gracefully if the browser does not support the modern methods (namely IE)?
I am using jinja2 framework, if that is relevant. (I am a Python novice by the way)
Thanks in advance!
For upload a file as a blob in GAE you need the
blobstore_handlers
from built-in framework calledwebapp
. The docs have a complete sample for upload files and I do not think there are other ways to upload to the blobstore.When you have the blob see the first sample of this page from docs for attach the blob to the email.
Now, for a "temp file solution" you can try a different way: write the upload file to the ram with StringIO python module. Something like that: