Upload file bigger than 40MB to Google App Engine?

10 views
Skip to first unread message

Nicolas Raoul via StackOverflow

unread,
Mar 11, 2017, 4:37:05 PM3/11/17
to google-appengin...@googlegroups.com

I am creating a Google App Engine web app to "transform" files of 10K~50M

Scenario:

  1. User opens http://fixdeck.appspot.com in web browser
  2. User clicks on "Browse", select file, submits
  3. Servlet loads file as an InputStream
  4. Servlet transforms file
  5. Servlet saves file as an OutputStream
  6. The user's browser receives the transformed file and asks where to save it, directly as a response to the request in step 2

(For now I did not implement step 4, the servlet sends the file back without transforming it.)

Problem: It works for 15MB files but not for a 40MB file, saying: "Error: Request Entity Too Large. Your client issued a request that was too large."

Is there any workaround against this?

Source code: https://github.com/nicolas-raoul/transdeck
Rationale: http://code.google.com/p/ankidroid/issues/detail?id=697



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/6898736/upload-file-bigger-than-40mb-to-google-app-engine

Karthikkumar via StackOverflow

unread,
Mar 11, 2017, 4:37:07 PM3/11/17
to google-appengin...@googlegroups.com

You can also use blobstore api to directly upload to cloud storage. Blow is the link

https://cloud.google.com/appengine/docs/python/blobstore/#Python_Using_the_Blobstore_API_with_Google_Cloud_Storage

upload_url = blobstore.create_upload_url(
  '/upload_handler',
  gs‌​_bucket_name = YOUR.BUCKET_NAME)

template_values = { 'upload_url': upload_url } 
_jinjaEnvironment = jinjaEnvironment.JinjaClass.getJinjaEnvironemtVariable()

if _jinjaEnvironment: 
  template = _jinjaEnvironment.get_template('import.html')

Then in index.html:

<form action="{{ upload_url }}" 
      method="POST" 
      enctype="multipart/form-data">
  Upload File:
  <input type="file" name="file">
</form>


Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/6898736/upload-file-bigger-than-40mb-to-google-app-engine/36210402#36210402
Reply all
Reply to author
Forward
0 new messages