sayanroyc / Spartan_Server

0 stars 0 forks source link

Test image upload functions #18

Closed nickgarfield closed 8 years ago

nickgarfield commented 8 years ago

This includes changing the profile image of a user and uploading new images for an item.

sayanroyc commented 8 years ago

Moved to blobs.py. In webapp form, NOT flask (yet). The current method for uploading:

curl URL.../blobs/new_user_image (returns a URL, let us call it uploadURL) curl -X POST -F "file=@C:/.....dickpic.jpg" uploadURL

Another issue (probably simple fix): can't send both data and a file using the curl command. For example, you can't do curl -d "user_id"="3458237452834" -f "##imageFile##" uploadURL

sayanroyc commented 8 years ago

http://stackoverflow.com/questions/31446308/app-engine-blobstore-self-get-uploads-empty http://stackoverflow.com/questions/18061264/serve-image-from-gae-datastore-with-flask-python http://stackoverflow.com/questions/14784295/handling-image-upload-with-blobstoreuploadhandler-and-returning-a-json-message

nickgarfield commented 8 years ago

So is it not doable with Flask?

sayanroyc commented 8 years ago

It is doable, have yet to find some working flask syntax though. Some of the function calls in what I have are webapp specific.

sayanroyc commented 8 years ago

Google Cloud Storage is the way to go. You're right, blobstore is outdated. It's $0.02 or $0.026/GB though. However, for the first 60 days, we get $300 credit from Google.

nickgarfield commented 8 years ago

Alright, Cloud Storage is definitely the way to go for storing images. With the account I created though, I think we only have 7 days left of the first 60

nickgarfield commented 8 years ago

Not having that 60 day credit though should be too big of a cost. For testing purposes, we probably won't have more than 1 or 2 GB of photos uploaded. And it's $0.02 per month per GB. So it might cost like $0.04 to finish off our developing and testing

sayanroyc commented 8 years ago

Image uploading to the cloud works using Cloud Storage (buckets).