Create an absolute URL that can be used by a user to
asynchronously upload a large blob. Upon completion of the
upload, a callback is made to the specified URL.
Create an absolute URL that can be used by a user to
asynchronously upload a large blob. Upon completion of the
upload, a callback is made to the specified URL.
Returns the BlobInfo for any files that were uploaded, keyed by the
upload form "name" field.
This method should only be called from within a request served by
the destination of a #createUploadUrl call.
See Also: #getUploads, #getFileInfos
Returns the FileInfo for any files that were uploaded, keyed by the
upload form "name" field.
This method should only be called from within a request served by
the destination of a #createUploadUrl call.
Prefer this method over #getBlobInfos or #getUploads if
uploading files to Cloud Storage, as the FileInfo contains the name of the
created filename in Cloud Storage.
See Also: #getUploads, #getBlobInfos
Deprecated.Use #getUploads instead. Note that getUploadedBlobs
does not handle cases where blobs have been uploaded using the
multiple="true" attribute of the file input form element.
Returns the BlobKey for any files that were uploaded, keyed by the
upload form "name" field.
This method should only be called from within a request served by
the destination of a createUploadUrl call.
Returns the BlobKey for any files that were uploaded, keyed by the
upload form "name" field.
This method should only be called from within a request served by
the destination of a #createUploadUrl call.
See Also: #getFileInfos, #getBlobInfos
Arrange for the specified blob to be served as the response
content for the current request. response should be
uncommitted before invoking this method, and should be assumed to
be committed after invoking it. Any content written before
calling this method will be ignored. You may, however, append
custom headers before or after calling this method.
This method will set the App Engine blob range header to serve a
byte range of that blob.
Arrange for the specified blob to be served as the response
content for the current request. response should be
uncommitted before invoking this method, and should be assumed to
be committed after invoking it. Any content written before
calling this method will be ignored. You may, however, append
custom headers before or after calling this method.
Range header will be automatically translated from the Content-Range
header in the response.
Arrange for the specified blob to be served as the response
content for the current request. response should be
uncommitted before invoking this method, and should be assumed to
be committed after invoking it. Any content written before
calling this method will be ignored. You may, however, append
custom headers before or after calling this method.
This method will set the App Engine blob range header to the content
specified.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eBlobstoreService\u003c/code\u003e is used for managing the creation and serving of large, immutable blobs to users.\u003c/p\u003e\n"],["\u003cp\u003eYou can create a \u003ccode\u003eBlobKey\u003c/code\u003e for a Google Storage file using \u003ccode\u003ecreateGsBlobKey(String filename)\u003c/code\u003e, which doesn't check for the file's existence but allows for the key to be used with Google Storage objects.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ecreateUploadUrl\u003c/code\u003e creates an absolute URL for users to asynchronously upload large blobs, with a specified callback URL for when the upload is complete.\u003c/p\u003e\n"],["\u003cp\u003eUploaded files can be accessed using \u003ccode\u003egetUploads\u003c/code\u003e, \u003ccode\u003egetFileInfos\u003c/code\u003e, or \u003ccode\u003egetBlobInfos\u003c/code\u003e, which provide different types of information about the uploaded files.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eserve\u003c/code\u003e methods enable you to serve a specified blob as the response content for the current request, with options to specify byte ranges or handle range headers.\u003c/p\u003e\n"]]],[],null,["# Interface BlobstoreService (2.0.0)\n\n public interface BlobstoreService\n\n`BlobstoreService` allows you to manage the creation and\nserving of large, immutable blobs to users.\n\nStatic Fields\n-------------\n\n### MAX_BLOB_FETCH_SIZE\n\n public static final int MAX_BLOB_FETCH_SIZE\n\nMethods\n-------\n\n### createGsBlobKey(String filename)\n\n public abstract BlobKey createGsBlobKey(String filename)\n\nCreate a [BlobKey](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.BlobKey) for a Google Storage File.\n\nThe existence of the file represented by filename is not checked, hence a BlobKey can be\ncreated for a file that does not currently exist.\n\nYou can safely persist the [BlobKey](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.BlobKey) generated by this function.\n\nThe created [BlobKey](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.BlobKey) can then be used as a parameter in API methods that can support\nobjects in Google Storage, for example serve.\n\n### createUploadUrl(String successPath)\n\n public abstract String createUploadUrl(String successPath)\n\nCreate an absolute URL that can be used by a user to\nasynchronously upload a large blob. Upon completion of the\nupload, a callback is made to the specified URL.\n\n### createUploadUrl(String successPath, UploadOptions uploadOptions)\n\n public abstract String createUploadUrl(String successPath, UploadOptions uploadOptions)\n\nCreate an absolute URL that can be used by a user to\nasynchronously upload a large blob. Upon completion of the\nupload, a callback is made to the specified URL.\n\n### delete(BlobKey\\[\\] blobKeys)\n\n public abstract void delete(BlobKey[] blobKeys)\n\nPermanently deletes the specified blobs. Deleting unknown blobs is a\nno-op.\n\n### fetchData(BlobKey blobKey, long startIndex, long endIndex)\n\n public abstract byte[] fetchData(BlobKey blobKey, long startIndex, long endIndex)\n\nGet fragment from specified blob.\n\n### getBlobInfos(HttpServletRequest request)\n\n public abstract Map\u003cString,List\u003cBlobInfo\u003e\u003e getBlobInfos(HttpServletRequest request)\n\nReturns the [BlobInfo](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.BlobInfo) for any files that were uploaded, keyed by the\nupload form \"name\" field.\nThis method should only be called from within a request served by\nthe destination of a [#createUploadUrl](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.ee10.BlobstoreService#com_google_appengine_api_blobstore_ee10_BlobstoreService_createUploadUrl_) call.\nSee Also: [#getUploads](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.ee10.BlobstoreService#com_google_appengine_api_blobstore_ee10_BlobstoreService_getUploads_), [#getFileInfos](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.ee10.BlobstoreService#com_google_appengine_api_blobstore_ee10_BlobstoreService_getFileInfos_)\n\n### getByteRange(HttpServletRequest request)\n\n public abstract @Nullable ByteRange getByteRange(HttpServletRequest request)\n\nGet byte range from the request.\n\n### getFileInfos(HttpServletRequest request)\n\n public abstract Map\u003cString,List\u003cFileInfo\u003e\u003e getFileInfos(HttpServletRequest request)\n\nReturns the [FileInfo](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.FileInfo) for any files that were uploaded, keyed by the\nupload form \"name\" field.\nThis method should only be called from within a request served by\nthe destination of a [#createUploadUrl](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.ee10.BlobstoreService#com_google_appengine_api_blobstore_ee10_BlobstoreService_createUploadUrl_) call.\n\nPrefer this method over [#getBlobInfos](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.ee10.BlobstoreService#com_google_appengine_api_blobstore_ee10_BlobstoreService_getBlobInfos_) or [#getUploads](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.ee10.BlobstoreService#com_google_appengine_api_blobstore_ee10_BlobstoreService_getUploads_) if\nuploading files to Cloud Storage, as the FileInfo contains the name of the\ncreated filename in Cloud Storage.\nSee Also: [#getUploads](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.ee10.BlobstoreService#com_google_appengine_api_blobstore_ee10_BlobstoreService_getUploads_), [#getBlobInfos](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.ee10.BlobstoreService#com_google_appengine_api_blobstore_ee10_BlobstoreService_getBlobInfos_)\n\n### getUploadedBlobs(HttpServletRequest request) (deprecated)\n\n public abstract Map\u003cString,BlobKey\u003e getUploadedBlobs(HttpServletRequest request)\n\n**Deprecated.** *Use [#getUploads](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.ee10.BlobstoreService#com_google_appengine_api_blobstore_ee10_BlobstoreService_getUploads_) instead. Note that getUploadedBlobs\ndoes not handle cases where blobs have been uploaded using the\nmultiple=\"true\" attribute of the file input form element.*\n\nReturns the [BlobKey](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.BlobKey) for any files that were uploaded, keyed by the\nupload form \"name\" field.\n\nThis method should only be called from within a request served by\nthe destination of a `createUploadUrl` call.\n\n### getUploads(HttpServletRequest request)\n\n public abstract Map\u003cString,List\u003cBlobKey\u003e\u003e getUploads(HttpServletRequest request)\n\nReturns the [BlobKey](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.BlobKey) for any files that were uploaded, keyed by the\nupload form \"name\" field.\nThis method should only be called from within a request served by\nthe destination of a [#createUploadUrl](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.ee10.BlobstoreService#com_google_appengine_api_blobstore_ee10_BlobstoreService_createUploadUrl_) call.\nSee Also: [#getFileInfos](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.ee10.BlobstoreService#com_google_appengine_api_blobstore_ee10_BlobstoreService_getFileInfos_), [#getBlobInfos](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.ee10.BlobstoreService#com_google_appengine_api_blobstore_ee10_BlobstoreService_getBlobInfos_)\n\n### serve(BlobKey blobKey, @Nullable ByteRange byteRange, HttpServletResponse response)\n\n public abstract void serve(BlobKey blobKey, @Nullable ByteRange byteRange, HttpServletResponse response)\n\nArrange for the specified blob to be served as the response\ncontent for the current request. `response` should be\nuncommitted before invoking this method, and should be assumed to\nbe committed after invoking it. Any content written before\ncalling this method will be ignored. You may, however, append\ncustom headers before or after calling this method.\n\nThis method will set the App Engine blob range header to serve a\nbyte range of that blob.\n\n### serve(BlobKey blobKey, HttpServletResponse response)\n\n public abstract void serve(BlobKey blobKey, HttpServletResponse response)\n\nArrange for the specified blob to be served as the response\ncontent for the current request. `response` should be\nuncommitted before invoking this method, and should be assumed to\nbe committed after invoking it. Any content written before\ncalling this method will be ignored. You may, however, append\ncustom headers before or after calling this method.\n\nRange header will be automatically translated from the Content-Range\nheader in the response.\n\n### serve(BlobKey blobKey, String rangeHeader, HttpServletResponse response)\n\n public abstract void serve(BlobKey blobKey, String rangeHeader, HttpServletResponse response)\n\nArrange for the specified blob to be served as the response\ncontent for the current request. `response` should be\nuncommitted before invoking this method, and should be assumed to\nbe committed after invoking it. Any content written before\ncalling this method will be ignored. You may, however, append\ncustom headers before or after calling this method.\n\nThis method will set the App Engine blob range header to the content\nspecified."]]