Class: FileService

FileService

The FileService class is used to perform operations on the Microsoft Azure File Service. The File Service provides storage for binary large objects, and provides functions for working with data stored in files.

For more information on the File Service, as well as task focused information on using it in a Node.js application, see How to Use the File Service from Node.js. The following defaults can be set on the file service. defaultTimeoutIntervalInMs The default timeout interval, in milliseconds, to use for request made via the file service. defaultMaximumExecutionTimeInMs The default maximum execution time across all potential retries, for requests made via the file service. defaultLocationMode The default location mode for requests made via the file service. parallelOperationThreadCount The number of parallel operations that may be performed when uploading a file. useNagleAlgorithm Determines whether the Nagle algorithm is used for requests made via the file service; true to use the
Nagle algorithm; otherwise, false. The default value is false.

new FileService(storageAccountOrConnectionString, storageAccessKey, host, sasToken)

Creates a new FileService object. If no connection string or storageaccount and storageaccesskey are provided, the AZURE_STORAGE_CONNECTION_STRING or AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY environment variables will be used.

Parameters:
Name Type Argument Description
storageAccountOrConnectionString string <optional>

The storage account or the connection string.

storageAccessKey string <optional>

The storage access key.

host string | object <optional>

The host address. To define primary only, pass a string. Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.

sasToken string <optional>

The Shared Access Signature token.

Source:

Extends

  • StorageServiceClient

Methods

abortCopyFile(share, directory, file, copyId, options, callback)

Abort a file copy operation.

This:
Parameters:
Name Type Argument Description
share string

The destination share name.

directory string

The destination directory name.

file string

The destination file name.

copyId string

The copy operation identifier.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain the file information. response will contain information related to this operation.

Source:

clearRange(share, directory, file, rangeStart, rangeEnd, options, callback)

Clears a range. Clears all of the ranges by default, or only the ranges over a specific range of bytes if rangeStart and rangeEnd are specified.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

rangeStart int

The range start.

rangeEnd int

The range end.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain the directory information. response will contain information related to this operation.

Source:

createDirectory(share, directory, options, callback)

Creates a new directory under the specified account. If a directory with the same name already exists, the operation fails.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain the directory information. response will contain information related to this operation.

Source:

createDirectoryIfNotExists(share, directory, options, callback)

Creates a new directory under the specified account if the directory does not exists.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will be true if the directory was created, or false if the directory already exists. response will contain information related to this operation.

Source:
Example
var azure = require('azure-storage');
var FileService = azure.createFileService();
FileService.createDirectoryIfNotExists('taskshare', taskdirectory', function(error) {
  if(!error) {
    // Directory created or already existed
  }
}); 

createFile(share, directory, file, length, options, callback)

Creates a file of the specified length. If the file already exists on the service, it will be overwritten.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

length int

The length of the file in bytes.

options object <optional>

The request options.

Properties
Name Type Argument Description
metadata object <optional>

The metadata key/value pairs.

contentType string <optional>

The MIME content type of the file. The default type is application/octet-stream.

contentEncoding string <optional>

The content encodings that have been applied to the file.

contentLanguage string <optional>

The natural languages used by this resource.

contentMD5 string <optional>

The MD5 hash of the file content.

cacheControl string <optional>

The file service stores this value but does not use or modify it.

contentDisposition string <optional>

The file's content disposition. (x-ms-File-content-disposition)

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain the directory information. response will contain information related to this operation.

Source:

createFileFromLocalFile(share, directory, file, (string), options, callback) → {SpeedSummary}

Uploads a file to storage from a local file. If the file already exists on the service, it will be overwritten.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

(string)

localFileName The local path to the file to be uploaded.

options object <optional>

The request options.

Properties
Name Type Argument Description
speedSummary SpeedSummary <optional>

The download tracker objects;

metadata object <optional>

The metadata key/value pairs.

storeFileContentMD5 bool <optional>

Specifies whether the file's ContentMD5 header should be set on uploads. The default value is false for files.

useTransactionalMD5 bool <optional>

Calculate and send/validate content MD5 for transactions.

contentType string <optional>

The MIME content type of the file. The default type is application/octet-stream.

contentEncoding string <optional>

The content encodings that have been applied to the file.

contentLanguage string <optional>

The natural languages used by this resource.

contentMD5 string <optional>

The MD5 hash of the file content.

cacheControl string <optional>

The file service stores this value but does not use or modify it.

contentDisposition string <optional>

The file's content disposition. (x-ms-File-content-disposition)

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

The callback function.

Source:
Returns:
Type
SpeedSummary

createFileFromStream(share, directory, file, (Stream), streamLength, options, callback) → {SpeedSummary}

Uploads a file from a stream. If the file already exists on the service, it will be overwritten.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

(Stream)

stream Stream to the data to store.

streamLength int

The length of the stream to upload.

options object <optional>

The request options.

Properties
Name Type Argument Description
speedSummary SpeedSummary <optional>

The download tracker objects;

metadata object <optional>

The metadata key/value pairs.

storeFileContentMD5 bool <optional>

Specifies whether the file's ContentMD5 header should be set on uploads. The default value is false for files.

useTransactionalMD5 bool <optional>

Calculate and send/validate content MD5 for transactions.

contentType string <optional>

The MIME content type of the file. The default type is application/octet-stream.

contentEncoding string <optional>

The content encodings that have been applied to the file.

contentLanguage string <optional>

The natural languages used by this resource.

contentMD5 string <optional>

The MD5 hash of the file content.

cacheControl string <optional>

The file service stores this value but does not use or modify it.

contentDisposition string <optional>

The file's content disposition. (x-ms-File-content-disposition)

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

The callback function.

Source:
Returns:
Type
SpeedSummary

createFileFromText(share, directory, file, text, options, callback)

Uploads a file from a text string. If the file already exists on the service, it will be overwritten.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

text string | object

The file text, as a string or in a Buffer.

options object <optional>

The request options.

Properties
Name Type Argument Description
speedSummary SpeedSummary <optional>

The upload tracker objects;

metadata object <optional>

The metadata key/value pairs.

storeFileContentMD5 bool <optional>

Specifies whether the file's ContentMD5 header should be set on uploads. The default value is false for files.

useTransactionalMD5 bool <optional>

Calculate and send/validate content MD5 for transactions.

contentType string <optional>

The MIME content type of the file. The default type is application/octet-stream.

contentEncoding string <optional>

The content encodings that have been applied to the file.

contentLanguage string <optional>

The natural languages used by this resource.

contentMD5 string <optional>

The MD5 hash of the file content.

cacheControl string <optional>

The file service stores this value but does not use or modify it.

contentDisposition string <optional>

The file's content disposition. (x-ms-File-content-disposition)

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback FileService~FileToText

error will contain information if an error occurs; otherwise text will contain the file contents, and file will contain the file information. response will contain information related to this operation.

Source:

createRangesFromStream(share, directory, file, readStream, rangeStart, rangeEnd, options, callback)

Updates a range from a stream.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

readStream Stream

The read stream.

rangeStart int

The range start.

rangeEnd int

The range end.

options object <optional>

The request options.

Properties
Name Type Argument Description
useTransactionalMD5 bool <optional>

Calculate and send/validate content MD5 for transactions.

contentMD5 string <optional>

An optional hash value used to ensure transactional integrity for the page.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain the file information. response will contain information related to this operation.

Source:

createReadStream(share, directory, file, options, callback) → {Stream}

Provides a stream to read from a file.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
rangeStart string <optional>

Return only the bytes of the file in the specified range.

rangeEnd string <optional>

Return only the bytes of the file in the specified range.

useTransactionalMD5 boolean <optional>

When set to true, Calculate and send/validate content MD5 for transactions.

disableContentMD5Validation boolean <optional>

When set to true, MD5 validation will be disabled when downloading files.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain the file information. response will contain information related to this operation.

Source:
Returns:
Type
Stream
Example
var azure = require('azure-storage');
var fileService = azure.createFileService();
var writable = fs.createWriteStream(destinationFileNameTarget);
fileService.createReadStream(shareName, directoryName, fileName).pipe(writable);

createShare(share, options, callback)

Creates a new share under the specified account. If a share with the same name already exists, the operation fails.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
quota int <optional>

Specifies the maximum size of the share, in gigabytes.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

metadata object <optional>

The metadata key/value pairs.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain the share information. response will contain information related to this operation.

Source:

createShareIfNotExists(share, options, callback)

Creates a new share under the specified account if the share does not exists.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

metadata object <optional>

The metadata key/value pairs.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will be true if the share was created, or false if the share already exists. response will contain information related to this operation.

Source:
Example
var azure = require('azure-storage');
var FileService = azure.createFileService();
FileService.createShareIfNotExists('taskshare', function(error) {
  if(!error) {
    // Share created or already existed
  }
}); 

createWriteStreamToExistingFile(share, directory, file, options, callback) → {Stream}

Provides a stream to write to a file. Assumes that the file exists. If it does not, please create the file using createFile before calling this method or use createWriteStreamNewFile.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
speedSummary SpeedSummary <optional>

The download tracker objects;

metadata object <optional>

The metadata key/value pairs.

storeFileContentMD5 bool <optional>

Specifies whether the file's ContentMD5 header should be set on uploads. The default value is false for files.

useTransactionalMD5 bool <optional>

Calculate and send/validate content MD5 for transactions.

contentType string <optional>

The MIME content type of the file. The default type is application/octet-stream.

contentEncoding string <optional>

The content encodings that have been applied to the file.

contentLanguage string <optional>

The natural languages used by this resource.

contentMD5 string <optional>

The MD5 hash of the file content.

cacheControl string <optional>

The file service stores this value but does not use or modify it.

contentDisposition string <optional>

The file's content disposition. (x-ms-File-content-disposition)

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

The callback function.

Source:
Returns:
Type
Stream
Example
var azure = require('azure-storage');
var FileService = azure.createFileService();
FileService.createFile(shareName, directoryName, fileName, 1024, function (err) {
  // Pipe file to a file
  var stream = fs.createReadStream(fileNameTarget).pipe(FileService.createWriteStreamToExistingFile(shareName, directoryName, fileName));
});

createWriteStreamToNewFile(share, directory, file, length, options, callback) → {Stream}

Provides a stream to write to a file. Creates the file before writing data.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

length string

The file length.

options object <optional>

The request options.

Properties
Name Type Argument Description
speedSummary SpeedSummary <optional>

The download tracker objects;

metadata object <optional>

The metadata key/value pairs.

storeFileContentMD5 bool <optional>

Specifies whether the file's ContentMD5 header should be set on uploads. The default value is false for files.

useTransactionalMD5 bool <optional>

Calculate and send/validate content MD5 for transactions.

contentType string <optional>

The MIME content type of the file. The default type is application/octet-stream.

contentEncoding string <optional>

The content encodings that have been applied to the file.

contentLanguage string <optional>

The natural languages used by this resource.

contentMD5 string <optional>

The MD5 hash of the file content.

cacheControl string <optional>

The file service stores this value but does not use or modify it.

contentDisposition string <optional>

The file's content disposition. (x-ms-File-content-disposition)

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

The callback function.

Source:
Returns:
Type
Stream
Example
var azure = require('azure-storage');
var FileService = azure.createFileService();
var stream = fs.createReadStream(fileNameTarget).pipe(FileService.createWriteStreamToNewFile(shareName, directoryName, fileName));

deleteDirectory(share, directory, options, callback)

Marks the specified directory for deletion. The directory must be empty before it can be deleted.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResponse

error will contain information if an error occurs; otherwise response will contain information related to this operation.

Source:

deleteDirectoryIfExists(share, directory, options, callback)

Marks the specified directory for deletion if it exists. The directory must be empty before it can be deleted.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will be true if the directory exists and was deleted, or false if the directory did not exist. response will contain information related to this operation.

Source:

deleteFile(share, directory, file, options, callback)

Marks the specified file for deletion. The file is later deleted during garbage collection.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResponse

error will contain information if an error occurs; response will contain information related to this operation.

Source:

deleteFileIfExists(share, directory, file, options, callback)

Marks the specified file for deletion if it exists. The file is later deleted during garbage collection.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will be true if the file was deleted, or false if the file does not exist. response will contain information related to this operation.

Source:

deleteShare(share, options, callback)

Marks the specified share for deletion. The share and any files contained within it are later deleted during garbage collection.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResponse

error will contain information if an error occurs; otherwise response will contain information related to this operation.

Source:

deleteShareIfExists(share, options, callback)

Marks the specified share for deletion if it exists. The share and any files contained within it are later deleted during garbage collection.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will be true if the share exists and was deleted, or false if the share did not exist. response will contain information related to this operation.

Source:

doesDirectoryExist(share, directory, options, callback)

Checks whether or not a directory exists on the service.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will be true if the directory exists, or false if the directory does not exist. response will contain information related to this operation.

Source:

doesFileExist(share, directory, file, options, callback)

Checks whether or not a file exists on the service.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise errorOrResult will be true if the file exists, or false if the file does not exist. response will contain information related to this operation.

Source:

doesShareExist(share, options, callback)

Checks whether or not a share exists on the service.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will be true if the share exists, or false if the share does not exist. response will contain information related to this operation.

Source:

generateSharedAccessSignature(share, directory, file, sharedAccessPolicy, headers) → {string}

Retrieves a shared access signature token.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string <optional>

The directory name. Use '' to refer to the base directory.

file string <optional>

The file name.

sharedAccessPolicy object

The shared access policy.

Properties
Name Type Argument Description
Id string <optional>

The signed identifier.

AccessPolicy.Permissions object <optional>

The permission type.

AccessPolicy.Start date | string <optional>

The time at which the Shared Access Signature becomes valid (The UTC value will be used).

AccessPolicy.Expiry date | string <optional>

The time at which the Shared Access Signature becomes expired (The UTC value will be used).

AccessPolicy.IPAddressOrRange string <optional>

An IP address or a range of IP addresses from which to accept requests. When specifying a range, note that the range is inclusive.

AccessPolicy.Protocol string <optional>

The protocol permitted for a request made with the account SAS. Possible values are both HTTPS and HTTP (https,http) or HTTPS only (https). The default value is https,http.

headers object <optional>

The optional header values to set for a file returned wth this SAS.

Properties
Name Type Argument Description
cacheControl string <optional>

The optional value of the Cache-Control response header to be returned when this SAS is used.

contentType string <optional>

The optional value of the Content-Type response header to be returned when this SAS is used.

contentEncoding string <optional>

The optional value of the Content-Encoding response header to be returned when this SAS is used.

contentLanguage string <optional>

The optional value of the Content-Language response header to be returned when this SAS is used.

contentDisposition string <optional>

The optional value of the Content-Disposition response header to be returned when this SAS is used.

Source:
Returns:

The shared access signature query string. Note this string does not contain the leading "?".

Type
string

getDirectoryMetadata(share, directory, callback)

Returns all user-defined metadata for the specified directory.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

options.timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

options.maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

options.clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

options.useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain information about the file. response will contain information related to this operation.

Source:

getDirectoryProperties(share, directory, options, callback)

Retrieves a directory and its properties from a specified account.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain information for the directory. response will contain information related to this operation.

Source:

getFileMetadata(share, directory, file, callback)

Returns all user-defined metadata for the specified file. It does not modify or return the content of the file.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options.locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

options.timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

options.maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

options.clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

options.useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain information about the file. response will contain information related to this operation.

Source:

getFileProperties(share, directory, file, options, callback)

Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not return or modify the content of the file.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain information about the file. response will contain information related to this operation.

Source:

getFileToLocalFile(share, directory, file, localFileName, options, callback) → {SpeedSummary}

Downloads an Azure file into a file.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

localFileName string

The local path to the file to be downloaded.

options object <optional>

The request options.

Properties
Name Type Argument Description
skipSizeCheck boolean <optional>

Skip the size check to perform direct download. Set the option to true for small files. Parallel download and speed summary won't work with this option on.

speedSummary SpeedSummary <optional>

The download tracker objects.

rangeStart string <optional>

Return only the bytes of the file in the specified range.

rangeEnd string <optional>

Return only the bytes of the file in the specified range.

useTransactionalMD5 boolean <optional>

When set to true, Calculate and send/validate content MD5 for transactions.

disableContentMD5Validation boolean <optional>

When set to true, MD5 validation will be disabled when downloading files.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain the file information. response will contain information related to this operation.

Source:
Returns:
Type
SpeedSummary
Example
var azure = require('azure-storage');
var FileService = azure.createFileService();
FileService.getFileToLocalFile('taskshare', taskdirectory', 'task1', 'task1-download.txt', function(error, serverFile) {
  if(!error) {
    // file available in serverFile.file variable
  }

getFileToStream(share, directory, file, writeStream, options, callback) → {SpeedSummary}

Downloads a file into a stream.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

writeStream Stream

The write stream.

options object <optional>

The request options.

Properties
Name Type Argument Description
skipSizeCheck boolean <optional>

Skip the size check to perform direct download. Set the option to true for small files. Parallel download and speed summary won't work with this option on.

speedSummary SpeedSummary <optional>

The download tracker objects.

rangeStart string <optional>

Return only the bytes of the file in the specified range.

rangeEnd string <optional>

Return only the bytes of the file in the specified range.

useTransactionalMD5 boolean <optional>

When set to true, Calculate and send/validate content MD5 for transactions.

disableContentMD5Validation boolean <optional>

When set to true, MD5 validation will be disabled when downloading files.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain the file information. response will contain information related to this operation.

Source:
Returns:
Type
SpeedSummary
Example
var azure = require('azure-storage');
var FileService = azure.createFileService();
FileService.getFileToStream('taskshare', taskdirectory', 'task1', fs.createWriteStream('task1-download.txt'), function(error, serverFile) {
  if(!error) {
    // file available in serverFile.file variable
  }
}); 

getFileToText(share, directory, file, options, callback)

Downloads a file into a text string.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
rangeStart int <optional>

The range start.

rangeEnd int <optional>

The range end.

disableContentMD5Validation boolean <optional>

When set to true, MD5 validation will be disabled when downloading files.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback FileService~FileToText

error will contain information if an error occurs; otherwise text will contain the file contents, and file will contain the file information. response will contain information related to this operation.

Source:

getServiceProperties(options, callback)

Gets the properties of a storage account's File service, including Azure Storage Analytics.

This:
Parameters:
Name Type Argument Description
options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise, result will contain the properties and response will contain information related to this operation.

Source:

getShareAcl(share, options, callback)

Gets the share's ACL.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain information for the share. response will contain information related to this operation.

Source:

getShareMetadata(share, options, callback)

Returns all user-defined metadata for the share.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain information for the share. response will contain information related to this operation.

Source:

getShareProperties(share, options, callback)

Retrieves a share and its properties from a specified account.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain information for the share. response will contain information related to this operation.

Source:

getShareStats(share, options, callback)

Gets the share statistics for a share.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise, result will contain the stats and response will contain information related to this operation.

Source:

getUrl(share, directory, file, sasToken, primary) → {string}

Retrieves a file or directory URL.

Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string <optional>

The file name. File names may not start or end with the delimiter '/'.

sasToken string <optional>

The Shared Access Signature token.

primary boolean <optional>

A boolean representing whether to use the primary or the secondary endpoint.

Source:
Returns:

The formatted URL string.

Type
string
Example
var azure = require('azure-storage');
var FileService = azure.createFileService();
var url = FileService.getUrl(shareName, directoryName, fileName, sasToken, true);

listFilesAndDirectoriesSegmented(share, directory, currentToken, options, callback)

Lists a segment containing a collection of file items in the directory.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

currentToken object

A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.

options object <optional>

The request options.

Properties
Name Type Argument Description
maxResults int <optional>

Specifies the maximum number of files to return per call to Azure ServiceClient. This does NOT affect list size returned by this function. (maximum: 5000)

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

[options.maximumExecutionTimeInMs]The int

maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

options.clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

options.useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain entries.files, entries.directories and the continuationToken for the next listing operation. response will contain information related to this operation.

Source:

listRanges(share, directory, file, options, callback)

Lists file ranges. Lists all of the ranges by default, or only the ranges over a specific range of bytes if rangeStart and rangeEnd are specified.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
rangeStart int <optional>

The range start.

rangeEnd int <optional>

The range end.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain the range information. response will contain information related to this operation.

Source:

listSharesSegmented(currentToken, options, callback)

Lists a segment containing a collection of share items under the specified account.

This:
Parameters:
Name Type Argument Description
currentToken object

A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

maxResults int <optional>

Specifies the maximum number of shares to return per call to Azure storage.

include string <optional>

Include this parameter to specify that the share's metadata be returned as part of the response body. (allowed values: '', 'metadata')

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain entries and continuationToken. entries gives a list of shares and the continuationToken is used for the next listing operation. response will contain information related to this operation.

Source:

listSharesSegmentedWithPrefix(prefix, currentToken, options, callback)

Lists a segment containing a collection of share items whose names begin with the specified prefix under the specified account.

This:
Parameters:
Name Type Argument Description
prefix string

The prefix of the share name.

currentToken object

A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

prefix string <optional>

Filters the results to return only shares whose name begins with the specified prefix.

maxResults int <optional>

Specifies the maximum number of shares to return per call to Azure storage.

include string <optional>

Include this parameter to specify that the share's metadata be returned as part of the response body. (allowed values: '', 'metadata')

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain entries and continuationToken. entries gives a list of shares and the continuationToken is used for the next listing operation. response will contain information related to this operation.

Source:

resizeFile(share, directory, file, size, options, callback)

Resizes a file.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

size String

The size of the file, in bytes.

options object <optional>

The request options.

Properties
Name Type Argument Description
timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain information about the file. response will contain information related to this operation.

Source:

setDirectoryMetadata(share, directory, metadata, options, callback)

Sets user-defined metadata for the specified directory as one or more name-value pairs

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

metadata object

The metadata key/value pairs.

options object <optional>

The request options.

Properties
Name Type Argument Description
timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain information on the file. response will contain information related to this operation.

Source:

setFileMetadata(share, directory, file, metadata, options, callback)

Sets user-defined metadata for the specified file as one or more name-value pairs It does not modify or return the content of the file.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

metadata object

The metadata key/value pairs.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain information on the file. response will contain information related to this operation.

Source:

setFileProperties(share, directory, file, properties, options, callback)

Sets user-defined properties for the specified file. It does not modify or return the content of the file.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

properties object <optional>

The file properties to set.

Properties
Name Type Argument Description
contentType string <optional>

The MIME content type of the file. The default type is application/octet-stream.

contentEncoding string <optional>

The content encodings that have been applied to the file.

contentLanguage string <optional>

The natural languages used by this resource.

contentMD5 string <optional>

The MD5 hash of the file content.

cacheControl string <optional>

The file's cache control.

contentDisposition string <optional>

The file's content disposition.

contentLength string <optional>

Resizes a file to the specified size. If the specified byte value is less than the current size of the file, then all ranges above the specified byte value are cleared.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain information about the file. response will contain information related to this operation.

Source:

setServiceProperties(serviceProperties, options, callback)

Sets the properties of a storage account's File service, including Azure Storage Analytics. You can also use this operation to set the default request version for all incoming requests that do not have a version specified.

This:
Parameters:
Name Type Argument Description
serviceProperties object

The service properties.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResponse

error will contain information if an error occurs; otherwise, response will contain information related to this operation.

Source:

setShareAcl(share, signedIdentifiers, options, callback)

Updates the share's ACL.

This:
Parameters:
Name Type Argument Description
share string

The share name.

signedIdentifiers object

The signed identifiers. Signed identifiers must be in an array.

options object <optional>

The request options.

Properties
Name Type Argument Description
timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain information for the share. response will contain information related to this operation.

Source:

setShareMetadata(share, metadata, options, callback)

Sets the share's metadata.

Calling the Set Share Metadata operation overwrites all existing metadata that is associated with the share. It's not possible to modify an individual name/value pair.

This:
Parameters:
Name Type Argument Description
share string

The share name.

metadata object

The metadata key/value pairs.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResponse

error will contain information if an error occurs; otherwise response will contain information related to this operation.

Source:

setShareProperties(share, properties, options, callback)

Sets the properties for the specified share.

This:
Parameters:
Name Type Argument Description
share string

The share name.

properties object <optional>

The share properties to set.

Properties
Name Type Argument Description
quota string | int <optional>

Specifies the maximum size of the share, in gigabytes.

options object <optional>

The request options.

Properties
Name Type Argument Description
timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain information about the file. response will contain information related to this operation.

Source:

startCopyFile(sourceUri, targetShare, targetDirectory, targetFile, options, callback)

Starts to copy a file to a destination within the storage account.

This:
Parameters:
Name Type Argument Description
sourceUri string

The source file or blob URI.

targetShare string

The target share name.

targetDirectory string

The target directory name.

targetFile string

The target file name.

options object <optional>

The request options.

Properties
Name Type Argument Description
metadata object <optional>

The target file metadata key/value pairs.

accessConditions object <optional>

The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.

sourceAccessConditions object <optional>

The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to. Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request. The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise result will contain the file information. response will contain information related to this operation.

Source:

Type Definitions

FileToText(error, text, file, response)

The callback for {FileService~getFileToText}.

Parameters:
Name Type Description
error object

If an error occurs, the error information.

text string

The text returned from the file.

file object

Information about the file.

response object

Information related to this operation.

Source: