Created
March 8, 2016 22:49
-
-
Save lucadealfaro/6e83d9e4f70551f6109b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upload(): | |
f = request.vars.file.file # This is the file. | |
# See here for docs: https://cloud.google.com/appengine/docs/python/googlecloudstorageclient/functions | |
gcs_file = cloudstorate.open("mybucket/myfilename", 'w', content_type="image/jpeg") | |
gcs_file.write(f.read()) | |
gcs_file.close() | |
f.close() | |
return "ok" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment