How do I serve a PDF from a blob file on a Python web app?
-
I am trying to create a web app using Google App Engine (Python) that allows users to upload PDFs and view them later. I have been able to save the PDFs with BlobProperty in the NDB Datastore, but when I pull the files out of the database they are pure text strings with strange characters. I have tried using the object tag in HTML as well as PDFObject, but both take as input a url for the PDF rather than a blob file. Is there a way to go straight from my blob file to a PDF? I would be happy to only provide a downloadable link if it is too hard to actually display the PDF on the page.
-
Answer:
have you tried set your MIME type of response into application/pdf , may be that should work. And one more thing, may be you should have look at the encoding, since the BlobProperty are byte string.
Socrates Lee at Quora Visit the source
Related Q & A:
- How do I convert a PDF file to PDF/A in Delphi?Best solution by softwarerecs.stackexchange.com
- How do I make a python web program that is on a ubuntu server allow access to the server?Best solution by Yahoo! Answers
- How do I open a pdf file in my e'mail attachment?Best solution by Yahoo! Answers
- How can I send a file to a friend on Hotmail?Best solution by askdavetaylor.com
- How do I open a pdf on an email?Best solution by ehow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.