简体   繁体   中英

How to store blobstore images in the datastore using ajax?

I have a form which collects the Employee details. I have an option to upload the employee image. I need to store all these data in datastore through ajax. I am using Spring MVC to handle all the requests. I have tried the sample program given in appengine docs using form action. But how to do this operation with ajax? Thanks in advance...

You asked your question in a very abstract manner, so here is your abstract answer:

  1. Store the images in Blobstore or Google Cloud Storage
  2. The other form elements will be passed as query params to the generated upload URL
  3. Once Blobstore/GCS is done processing the upload, it will send a request to the callback route you specified, and that request handler will see a request with all the original params from your form, including a file metadata object.
  4. If you want to know how to do a file upload with ajax instead of a form element, check the link provided by the other user in a comment. You can also try google, to learn the particular syntax of sending file uploads from whichever ajax library you're using.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM