blobstore

Uploading a video to google app engine blobstore

旧街凉风 提交于 2019-12-03 21:09:44
I'm trying to associate a video file to a record with a bunch of properties, but can't seem to allow the user to do everything in one form - name the video, provide description and answer some question, AND upload the file. Here are the steps I'd like to perform: User is served with a page containing a form with the following fields: Name, Description, File selector. The file gets stored as a blob and the id gets recorded together with name and description. Does anyone have any examples of doing this I could learn from or a tutorial you could point me to? The one from google only shows

GAE Blobstore: ImagesService.getServingUrl() gives me smaller images

醉酒当歌 提交于 2019-12-03 19:56:23
问题 I'm uploading some images to GAE's Blobstore. Upload goes succesfully and when i see the images in GAE console i can see that they're stored in the expected size and resolution. According to this site, to get a URL to the uploaded image i can use this: BlobKey blobKey = (BlobKey) blobs.get("image"); ImagesService imagesService = ImagesServiceFactory.getImagesService(); String imageUrl = imagesService.getServingUrl(blobKey); The resulting URL points to a smaller version of the uploaded images

How to model many blobs for an object?

爷,独闯天下 提交于 2019-12-03 18:16:10
问题 I want to enable something like a one-to-many relation between a text object and blobs so that a text object (an "article" or likewise) has many images and/or videos. There are two ways I see how to do this where the first is using a list of blobs as instance variable. Will it work? class A(search.SearchableModel): blobs = db.ListProperty(blobstore.BlobReferenceProperty()) Advantages: Just one class. Readable and easy to get and set data. Disadvantages: Lacks extra info for blobs e.g. if I

Directly Putting Data in AppEngine's Blobstore

时光总嘲笑我的痴心妄想 提交于 2019-12-03 14:21:08
The AppEngine's standard API assumes files are uploaded from an HTML form. I'm trying to post a file to the blobstore from a REST API method that can be called by a non Html client (Flash, iPhone, etc.) The code I'm trying to get working: # Get the blobstore upload url upload_url = blobstore.create_upload_url("/activities/upload_finished"); # Make sync call to the blobstore url to post our image result = urlfetch.fetch(url=upload_url, payload=request.FILES, method=urlfetch.POST, headers={'Content-Type': 'multipart/form-data'}) I'm getting the following error: ValueError: Invalid boundary in

Downloaded filename with Google App Engine Blobstore

那年仲夏 提交于 2019-12-03 12:59:51
I'm using the Google App Engine Blobstore to store a range of file types (PDF, XLS, etc) and am trying to find a mechanism by which the original filename of the uploaded file - as stored in blob_info - can be used to name the downloaded file i.e. so that the user sees 'some_file.pdf' in the save dialogue rather than 'very_long_db_key.pdf'. I can't see anything in the docs that would allow this: http://code.google.com/appengine/docs/python/blobstore/overview.html I've seen hints in other posts that you could use the information in blob_info to set the content-disposition header. Is this the

Decode an App Engine Blobkey to a Google Cloud Storage Filename

北城余情 提交于 2019-12-03 11:06:44
I've got a database full of BlobKeys that were previously uploaded through the standard Google App Engine create_upload_url() process, and each of the uploads went to the same Google Cloud Storage bucket by setting the gs_bucket_name argument. What I'd like to do is be able to decode the existing blobkeys so I can get their Google Cloud Storage filenames. I understand that I could have been using the gs_object_name property from the FileInfo class , except: You must save the gs_object_name yourself in your upload handler or this data will be lost. (The other metadata for the object in GCS is

getting blobstore to callback to endpoint method

自古美人都是妖i 提交于 2019-12-03 08:48:46
I am developing an app-engine connected android project using the eclipse plugin. When I upload an image to the blobstore, how do I make it callback an endpoint method? I find great posts here that can be used as reference to understand my question better (if you need to). using blobstore with google cloud endpoint and android Saving blobs with Google Endpoint So really, I want to know how to make the callback url an endpoint method such as saveAnimalData below (I stole from referenced link) @ApiMethod(name = "saveAnimalData", httpMethod = HttpMethod.POST) public String saveAnimalData

Multiple file upload using GWT and AppEngine Blobstore?

会有一股神秘感。 提交于 2019-12-03 08:02:49
How would I go about creating a modern, Gmail-like, multiple file upload in GWT and AppEngine Blobstore? The solution most commonly proposed is gwtupload , an excellent GWT component written by Manolo Carrasco. However, the latest version 0.6.6 does not work with blobstore (at least I can't get it to work), and it does not support multiple file select. There's a patch for multiple file select in the latest 0.6.7 snapshot, but although it allows selection of multiple files (using the "multiple" attribute in HTML5), it stills sends them in one huge POST request (and progress is shown for the

Cost of storing a file in Datastore vs Blobstore

可紊 提交于 2019-12-03 07:08:17
Question: Since every file in the blobstore has an associated BlobInfo entity in the datastore, do I get charged the cost of write/read of that entity just like any other datastore entity? Background: We store millions of images on App Engine, and we're currently storing them in datastore entities (the images are smaller than 1MB). I'm wondering if using the blobstore would reduce our cost. I'm not concerned about the cost of storage. The real cost is the act of writing and reading, so that's what I'm trying to reduce. Right now we pay for the write and read of the datastore entities, one

How to get blob filename from BlobKey on app-engine

坚强是说给别人听的谎言 提交于 2019-12-02 07:35:06
This is a server side question. I have a BlobKey and nothing else. How do I get the blob filename from said BlobKey? I know how to get the servingUrl as ServingUrlOptions options = ServingUrlOptions.Builder.withBlobKey(blobKey).secureUrl(false); String servingUrl = ImagesServiceFactory.getImagesService().getServingUrl(options); But how do I get the filename as saved/shown in Blob Viewer as for instance image_1.png ? I am using Java -- not python. Use the BlobInfo class. BlobInfoFactory blobInfoFactory = new BlobInfoFactory(); BlobInfo blobInfo = blobInfoFactory.loadBlobInfo(blobKey); String