blobstore

Blobstore upload with javascript

岁酱吖の 提交于 2019-12-06 07:48:39
问题 This is the minimal declaration for the HTML in order to upload a file in Blobstore in the upload_url . What is required with this solution is required to click the Submit button in order the content to be submitted and get redirected. How can I do the post in the background with javascript or jQuery without losing the enctype? <form id="upload_file" action="{{upload_url}}" enctype="multipart/form-data" method="post"> <input type="file" name="file"> <input type="submit" name="submit" value=

Serving images directly from GCS in GAE using Blobstore API and Images API

こ雲淡風輕ζ 提交于 2019-12-06 06:12:04
问题 Many questions and answers on Blobstore and Google Cloud Storage(GCS) are two or three years old, while things change dramatically these years. GCS is no longer a standalone service. It is integrated into Google App Engine (GAE) now. Google seems to push GCS so hard that Blobstore is deprecated, for example, The Files API feature used here to write files to Blobstore has been deprecated and is going to be removed at some time in the future, in favor of writing files to Google Cloud Storage

How to use Google App Engine's Blobstore to save web images

╄→гoц情女王★ 提交于 2019-12-06 06:11:22
问题 UPDATE This question was originally asked at a time when there was no support for programmatic file creation (via url for example). That has changed, see: http://code.google.com/appengine/docs/java/blobstore/overview.html#Writing_Files_to_the_Blobstore I'm accessing a couple different APIs to fetch images. My application is GAE + Python and I want to use the Blobstore to save these images. The GAE Blobstore documentation provides clear examples of how to save images to Blobstore via a form,

How to upload image from url to Blobstore?

[亡魂溺海] 提交于 2019-12-05 20:03:46
The Google App Engine Files API now supports programmatic creation if blobstore blobs. I'm trying this out by attempting to fetch an image over http and store it to the blobstore: file_name = files.blobstore.create(mime_type='image/jpeg') image = urllib2.urlopen(url) with files.open(file_name, 'a') as f: f.write(image) # LINE 142 files.finalize(file_name) blob_key = files.blobstore.get_blob_key(file_name) This code is throwing the error: File "/Users/willmerydith/repos/spam/admin.py", line 142, in post f.write(image) File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources

Blobstore upload + Ajax/Alternative

不羁的心 提交于 2019-12-05 18:38:03
The following code works perfectly. My only concern is that I wanna convert below to AJAX/alternative, so that it doesn't need to refresh the whole page to submit this request. If possible, to also include loading progress bar etc. <form action="{{ upload_url }}" method="POST" enctype="multipart/form-data"> Upload File: <input type="file" name="file"> <br> <input type="submit" name="submit" value="Submit"> <input type="hidden" name="data1" value="{{ data1 }}"> <input type="hidden" name="data1" value="{{ data2 }}"> </form> sgammon Take a look at some JS solutions for AJAX upload - specifically,

Saving blobs with Google Endpoint

做~自己de王妃 提交于 2019-12-05 14:25:32
I have an app that allows users to save blobs in the blobstore. I have a schema that does so presently, but I am interested in something simpler and less twisted. For context, imagine my app allows users to upload the picture of an animal with a paragraph describing what the animal is doing. Present schema User calls my endpoint api to save the paragraph and name of the animal in entity Animal . Note: The Animal entity actually has 4 fields ( name , paragraph , BlobKey , and blobServingUrl as String). But the endpoint api only allows saving of the two mentioned. Within the endpoint method, on

How long does URL from ImagesService.getServingUrl last

给你一囗甜甜゛ 提交于 2019-12-05 10:21:29
I'm working with the blobstore and imagesService in App Engine. I'm wondering how long a URL I get from imagesService.getServingUrl(blobKey) will last. If I'm using this to store a users profile picture, can I store this URL in the user or should I store the BlobKey and get the servingUrl each time i need the picture? The URL will last indefinitely. You should definitely still store the blobkey anyway, though, or you will have no way to delete blobs once you no longer need them, or to get alternate image serving URLs. 来源: https://stackoverflow.com/questions/4643892/how-long-does-url-from

How long to blob urls served by the app engine remain valid?

杀马特。学长 韩版系。学妹 提交于 2019-12-05 10:11:10
I was wondering if anyone knew how long image urls served back from the google app engine blob store remain valid for? I have been tracking on url that i served an image from the blob store on 1/3/13 and its still there. I am ask specifically so i can cache the image url instead of attempting to serve it repeatedly. If i did this i would still check if the image is there, but how often would i need to check that thanks! They remain valid until either you a. call delete_serving_url , or b. delete the underling blob. 来源: https://stackoverflow.com/questions/14331245/how-long-to-blob-urls-served

Get a Google Cloud Storage file from its BlobKey

限于喜欢 提交于 2019-12-05 09:14:37
I wrote a Google App Engine application that makes use of Blobstore to save programmatically-generated data. To do so, I used the Files API , which unfortunately has been deprecated in favor to Google Cloud Storage. So I'm rewriting my helper class to work with GCS. I'd like to keep the interface as similar as possible as it was before, also because I persist BlobKeys in the Datastore to keep references to the files (and changing the model of a production application is always painful). When i save something to GCS, i retrieve a BlobKey with BlobKey blobKey = blobstoreService.createGsBlobKey("

How do I save web images to App Engine's blobstore?

人走茶凉 提交于 2019-12-04 19:15:28
I've used this question as a template to solve the same problem, but I'm running into issues when posting. I have these components: HTML form with a textbox for the image URL. This posts to... A handler that takes the posted URL, encodes it, and uses urlfetch to post it again to... A separate file upload handler that does the actual saving. Component #3 works fine by itself if I use a file input. But I don't quite understand how to get urlfetch what it needs from just the image URL. My process either times out or gets a 500 response from the final handler. # 1 class URLMainHandler