blobstore

Referencing Blobs in GAE the smart way

北城以北 提交于 2019-12-23 04:06:12
问题 I'm migrating a site from IIS to GAE and am trying to batch upload a lot of images. Further to that particular challenge, I have one that concerns me more. All of the content for the site (stored in a DB) reference the images as such: http://myurl.com/images/some-folder/maybe-another-folder/image-name.jpg I have created a simple handler in Python to serve images: class ServeBlobs(blobstore_handlers.BlobstoreDownloadHandler): def get(self, resource): query = "where filename='%s'" % resource

Blobstore upload + Ajax/Alternative

痴心易碎 提交于 2019-12-22 10:26:13
问题 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

Get a Google Cloud Storage file from its BlobKey

心不动则不痛 提交于 2019-12-22 05:24:15
问题 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

How to compress images with Google App Engine Blobstore

主宰稳场 提交于 2019-12-21 20:47:31
问题 We have an app that servers a series of images from blobstore. An example is here: http://lh4.ggpht.com/f76xUkRZLRkb_Qz5uu82TX3LoBRh4eYb9hxYwMRMLCk5ghO_OL0DW2v4rRnkewUyDWfBuBttgbUvuJJXwtFQosEB=s0 It was a huge png, so this downloads at 536K. If we resize it to 400 across, it's still huge (263k): http://lh4.ggpht.com/f76xUkRZLRkb_Qz5uu82TX3LoBRh4eYb9hxYwMRMLCk5ghO_OL0DW2v4rRnkewUyDWfBuBttgbUvuJJXwtFQosEB=s400 How can we request or store the picture in some kind of better compression? We have a

How to set filename property in BlobStore?

落花浮王杯 提交于 2019-12-21 09:21:36
问题 I'm programatically uploading image files and want to set the filename. When I upload a file via POST, the filename property is set automatically. However when using the method below, the filename is not getting set. image = urllib2.urlopen(url) file_name = files.blobstore.create(mime_type='image/png') with files.open(file_name, 'a') as f: f.write(image.read()) files.finalize(file_name) image_blob_key = files.blobstore.get_blob_key(file_name) 回答1: Parse the filename from the url (see related

How to set filename property in BlobStore?

蹲街弑〆低调 提交于 2019-12-21 09:20:42
问题 I'm programatically uploading image files and want to set the filename. When I upload a file via POST, the filename property is set automatically. However when using the method below, the filename is not getting set. image = urllib2.urlopen(url) file_name = files.blobstore.create(mime_type='image/png') with files.open(file_name, 'a') as f: f.write(image.read()) files.finalize(file_name) image_blob_key = files.blobstore.get_blob_key(file_name) 回答1: Parse the filename from the url (see related

Blobstore Images Disappearing on Google App Engine Development Server

拟墨画扇 提交于 2019-12-21 09:10:19
问题 I'm using App Engine's high performance image serving on my site, and I'm able to get everything working properly on both my local machine and in production i.e. I can upload an image and successfully display the images using get_serving_url on the blob key. However, these images don't seem to persist on my development server, i.e. after I come back from a computer restart, the images no longer show up. The development server spits out: images_service_pb.ImagesServiceError.BAD_IMAGE_DATA

Is it possible to create a google app engine end point which can upload a photo in a blobstore?

拥有回忆 提交于 2019-12-21 05:31:28
问题 I would like to know if is it possible to upload a photo in a appengine blobstore by using an end point ? If yes, please tell how or redirect to any available resource. If not, can you please expose any simple alternative : Using another library ? Using a standard servlet with other libraries ? 回答1: This post should be useful : serving blobstore image through app-engine endpoints api Please see another approach The Photofeed sample Java app. There is also a sample code . This app uses

How to get blob filename from BlobKey on app-engine

天大地大妈咪最大 提交于 2019-12-20 04:22:54
问题 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. 回答1: Use the BlobInfo class. BlobInfoFactory

How to convert NSString to UIImage for appengine blobstore

為{幸葍}努か 提交于 2019-12-19 10:48:26
问题 when I do the following the resulting image is null NSLog(@"string (%@) to base64NSData",object); NSData *base64Data = [[object dataUsingEncoding:NSUTF8StringEncoding] base64EncodedDataWithOptions:0]; NSLog(@"NSData (%@) to UIImage",base64Data); UIImage *image = [UIImage imageWithData:base64Data]; NSLog(@"my image is: %@",image); How might I do this well? Reason I need to save an image from iOS to the Google blobstore. I need to include some metadata with the image. When I encode the string