diff --git a/lib/storage/bucket.js b/lib/storage/bucket.js index fdcd248a8e4..14b5e8bd09a 100644 --- a/lib/storage/bucket.js +++ b/lib/storage/bucket.js @@ -864,9 +864,14 @@ Bucket.prototype.setMetadata = function(metadata, callback) { }; /** - * Upload a file to the bucket. This is a convenience method that wraps the - * functionality provided by a File object, {module:storage/file}. + * Upload a file to the bucket. This is a convenience method that wraps + * {module:storage/file#createWriteStream}. * + * You can specify whether or not an upload is resumable by setting + * `options.resumable`. *Resumable uploads are enabled by default if your input + * file is larger than 5 MB.* + * + * @resource [Upload Options (Simple or Resumable)]{@link https://cloud.google.com/storage/docs/json_api/v1/how-tos/upload#uploads} * @resource [Objects: insert API Documentation]{@link https://cloud.google.com/storage/docs/json_api/v1/objects/insert} * * @param {string} localPath - The fully qualified path to the file you wish to @@ -882,12 +887,7 @@ Bucket.prototype.setMetadata = function(metadata, callback) { * `options.metadata.contentEncoding` to `gzip`. * @param {object=} options.metadata - Metadata to set for your file. * @param {boolean=} options.resumable - Force a resumable upload. (default: - * true for files larger than 5MB). Read more about resumable uploads - * [here](http://goo.gl/1JWqCF). NOTE: This behavior is only possible with - * this method, and not {module:storage/file#createWriteStream}. When - * working with streams, the file format and size is unknown until it's - * completely consumed. Because of this, it's best for you to be explicit - * for what makes sense given your input. + * true for files larger than 5 MB). * @param {function} callback - The callback function. * @param {?error} callback.err - An error returned while making this request * @param {module:storage/file} callback.file - The uploaded File. diff --git a/lib/storage/file.js b/lib/storage/file.js index 0801ef83080..86f35cac688 100644 --- a/lib/storage/file.js +++ b/lib/storage/file.js @@ -621,9 +621,13 @@ File.prototype.createReadStream = function(options) { * * A File object can also be used to create files for the first time. * + * Resumable uploads are automatically enabled and must be shut off explicitly + * by setting `options.resumable` to `false`. + * * NOTE: Writable streams will emit the `complete` event when the file is fully * uploaded. * + * @resource [Upload Options (Simple or Resumable)]{@link https://cloud.google.com/storage/docs/json_api/v1/how-tos/upload#uploads} * @resource [Objects: insert API Documentation]{@link https://cloud.google.com/storage/docs/json_api/v1/objects/insert} * * @param {object=} options - Configuration object. @@ -633,8 +637,7 @@ File.prototype.createReadStream = function(options) { * @param {boolean} options.resumable - Force a resumable upload. NOTE: When * working with streams, the file format and size is unknown until it's * completely consumed. Because of this, it's best for you to be explicit - * for what makes sense given your input. Read more about resumable uploads - * [here](http://goo.gl/1JWqCF). + * for what makes sense given your input. * @param {string|boolean} options.validation - Possible values: `"md5"`, * `"crc32c"`, or `false`. By default, data integrity is validated with an * MD5 checksum for maximum reliability. CRC32c will provide better