blobstore

1MB quota limit for a blobstore object in Google App Engine?

こ雲淡風輕ζ 提交于 2019-12-29 06:19:13
问题 I'm using App Engine (version 1.4.3) direct write the blobstore in order to save images. when I try to store an image which is larger than 1MB I get the following Exception com.google.apphosting.api.ApiProxy$RequestTooLargeException: The request to API call datastore_v3.Put() was too large. I thought that the limit for each object is 2GB Here is the Java code that stores the image private void putInBlobStore(final String mimeType, final byte[] data) throws IOException { final FileService

simple HttpURLConnection POST file multipart/form-data from android to google blobstore

若如初见. 提交于 2019-12-27 17:00:02
问题 I have very little idea how html works.What i want to do is exactly similar to the following but on android <body> <form action="<%= some_url %>" method="post" enctype="multipart/form-data"> <input type="file" name="myFile"> <input type="submit" value="Submit"> </form> </body> I tried the following code - private static void postToUrl(String url_to_upload_on, String file_name_with_ext, byte[] byteArray) { String attachmentName = "file"; String attachmentFileName = file_name_with_ext; String

Images in Blobstore: inefficient to get metadata?

纵饮孤独 提交于 2019-12-25 14:38:09
问题 Summary: I'm using Blobstore to let users upload images to be served. I want to prevent users from uploading files that aren't valid images or have dimensions that are too large. I'm using App Engine's Images service to get the relevant metadata. BUT, in order to get any information about the image type or dimensions from the Images service, you have to first execute a transform, which fetches the transformed image to the App Engine server. I have it do a no-op crop and encode as a very low

Expected BlobKey but instead I get a BlobInfo object - How to get BlobKey from BlobInfo object?

余生颓废 提交于 2019-12-25 07:30:06
问题 What's the best way to get a BlobKey from a BlobInfo object? def get(self): blobs = BlobInfo.all() #something is missing here for blob in blobs: if not Content.query().filter(ndb.BlobKeyProperty("blobKey") == blob.key).count(1): #ERROR blob.delete() ^ **how do you do make this a normal BlobKey?** #Error BadValueError: Expected BlobKey, got <bound method BlobInfo.key of <google.appengine.ext.blobstore.blobstore.BlobInfo object at 0x048B87D0>> Thanks!! 回答1: BlobInfo.key is a method, not a

How to migrate from The Files API to Google Cloud Storage?

谁说我不能喝 提交于 2019-12-24 12:23:02
问题 I've got a message yesterday from Google saying that the Files API will be disabled on July 28th and it is recommended to migrate to Google Cloud Storage. Currently I use Files API in the following way - once email is received, I save its attachment (images only) to blobstore - from google.appengine.api import files bs_file = files.blobstore.create(mime_type=ctype, _blobinfo_uploaded_filename='screenshot_'+image_file_name) try: with files.open(bs_file, 'a') as f: f.write(image_file) files

Replacing BlobStore Upload Handler with GCS

﹥>﹥吖頭↗ 提交于 2019-12-24 07:56:34
问题 I'm looking at replacing our usage of the Blobstore API with GCS, per the recommendation in the Blobstore docs. As far as I can tell, the right way to allow a user to upload a files seems to be to pass them a signed URL where they can upload their data. The piece I'm missing is that the Blobstore API has an UploadHandler, which allows you to perform some actions when a file has been uploaded (e.g. store metadata in a database), and even return a response to the user's upload request. Is there

GAE : java.lang.NoClassDefFoundError: com/google/appengine/api/blobstore/BlobstoreServiceFactory

做~自己de王妃 提交于 2019-12-24 03:54:13
问题 Kindly help me with this. I am using blob store for saving images and it is working perfectly fine on my local environment. But when I deploy the same code the cloud it is throwing me the exception : java.lang.NoClassDefFoundError: com/google/appengine/api/blobstore/BlobstoreServiceFactory I am using GAE 1.8.4 回答1: Most likely, appengine-api.jar is missing from your war/WEB-INF/lib/ folder. If you use Eclipse, click on the Problems tab. You may see a warning saying that this jar is not

Data gets corrupted on form send, =\r\n introduced in the data every 75 characters?

扶醉桌前 提交于 2019-12-23 23:01:17
问题 I'm working on a project in Django nonrel, on Google App Engine, though I have a feeling my problem has nothing to do with either of these directly . I have a hidden field in one of the models that is defined like so: models.CharField(max_length=400, null=True, blank=True,default="{}") The field is meant to receive JSON data from a widget in my admin, and in the client its value changes properly. (Which data is being sent is irrelevant to my problem - whatever string is in the field value is

Creating BlobstoreKey from GoogleCloudStorage

无人久伴 提交于 2019-12-23 22:10:17
问题 I'm writting this code for a project using GAE. Im not using Blobstore but i need to use the servingUrl method. GcsFilename gcsFilename = new GcsFilename(myBucket, myFileName); BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService(); BlobKey blobKey = blobstoreService.createGsBlobKey( "/gs/" + gcsFilename.getBucketName() + "/" + gcsFilename.getObjectName()); ImagesService images = ImagesServiceFactory.getImagesService(); GcsFilename gcsFilename = new GcsFilename

Delete files from blobstore using file serving URL

房东的猫 提交于 2019-12-23 20:45:32
问题 In my app (GWT on GAE) we are storing on our database the serving URL that is stored on blobstore. When user selects one of these files and clicks "delete", we need to delete the file from blobstore. This is our code, but it is not deleting the file at all: public void remove(String fileURL) { BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService(); String key = getBlobKeyFromURL(fileURL); BlobKey blobKey = new BlobKey(key); blobstoreService.delete(blobKey); } Where