How to read downloaded file in Google App Engine

Hi, I have one more question in the app. You have one form where there is one field for downloading the file, I need to read the downloaded file, check it and save it to the data store.

My question is, how can I read the downloaded file?

In django I would use request.FILES, is there anything like that in GAE?

I would be grateful for any help in this.

+3
source share
2 answers

This question has been answered Uploading files to Google App Engine

Google engine docs also explain this. http://code.google.com/appengine/docs/images/usingimages.html#Uploading

, self.request.get('name_of_file_in_the_input_form')

+2

Google App Engine . 3 : blodproperty, blobstore blobstoreuploadhandler. blobstorehandler , , , . URL- :

 self.render_template("upload.html", {
    'form': form,#optional if you have a form class
    'form_url': blobstore.create_upload_url('/fileupload'),
})

class FileUploadHandler(blobstore_handlers.BlobstoreUploadHandler):
  def post(self):         
    try:
        if self.get_uploads()[0]:
            blob_info = self.get_uploads()[0]
0

All Articles