Is Go faster than Python on Google App Engine?

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

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

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.