Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/storage/bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
7 changes: 5 additions & 2 deletions lib/storage/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down