简体   繁体   中英

How can I upload an image using AJAX to google cloud storage?

I'm new to Python Development, so in your answer please consider to not leave out things you may consider obvious. (I'm used to PHP development)

Here's the process I want to do:
- Allow user to use file picker and upload image(s) to a remote server using AJAX
- Convert image to blob value
- Store image ID on remote server database

Pitfalls:
- I will be receiving images with multiple file encodings, (jpg, png)

My question(s) is(are) am I thinking about this problem correctly? Is this the normal order and standard practice for this problem? - Would it be better to upload to google app engine instead? Would that change the way I needed to authenticate?

Well, this kind of question is quite general and a complete answer would be quite lengthy. There is an open source problem forked from the "famous" gae-init framework, gae-init-upload which demonstrates the upload and store process with Ajax and Google App Engine as a back end. You can fork the repository and play around with it. You can also play with demo .

Jquery-file-upload might be what you are looking for, it is a jQuery plugin which allows the user to select files, and then displays a progress bar as the files upload via ajax.

It is fairly easy to integrate with gae, more info here: https://github.com/blueimp/jQuery-File-Upload/wiki/Google-App-Engine .

It looks to me, like you are tackling the problem well. I have used gae to store images, and due to it's cloud nature, found it very fast for both storing and retrieving images.

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