Updated: August 4, 2015
The Get File operation reads or downloads a file from the system, including its metadata and properties.
The Get File request may be constructed as follows. HTTPS is recommended.
Replace the path components shown in the request URI with your own, as follows:
The name of your storage account.
The name of your file share.
Optional. The path to the directory.
The name of the file.
For details on path naming restrictions, see Naming and Referencing Shares, Directories, Files, and Metadata.
The following additional parameters may be specified on the request URI.
Optional. The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations.
The following table describes required and optional request headers.
Required. Specifies the authentication scheme, account name, and signature. For more information, see Authentication for the Azure Storage Services.
Date or x-ms-date
Required. Specifies the Coordinated Universal Time (UTC) for the request. For more information, see Authentication for the Azure Storage Services.
Required for all authenticated requests. Specifies the version of the operation to use for this request For more information, see Versioning for the Azure Storage Services.
Optional. Return file data only from the specified byte range.
Optional. Return file data only from the specified byte range. If both Range and x-ms-range are specified, the service uses the value of x-ms-range. If neither are specified, the entire file contents are returned. See Specifying the Range Header for File Service Operations for more information.
Optional. When this header is set to true and specified together with the Range header, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size.
If this header is specified without the Range header, the service returns status code 400 (Bad Request).
If this header is set to true when the range exceeds 4 MB in size, the service returns status code 400 (Bad Request).
The response includes an HTTP status code, a set of response headers, and the response body, which contains the contents of the file.
A successful operation returns status code 200 (OK).
For information about status codes, see Status and Error Codes.
The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.
Returns the date and time the file was last modified. The date format follows RFC 1123. For more information, see Representation of Date/Time Values in Headers. Any operation that modifies the file or its properties updates the last modified time.
A set of name-value pairs associated with this file as user-defined metadata.
The number of bytes present in the response body.
The content type specified for the file. The default content type is application/octet-stream.
Indicates the range of bytes returned if the client requested a subset of the file by setting the Range request header.
The ETag contains a value that you can use to perform operations conditionally, in quotes.
If the file has an MD5 hash and the request is to read the full file, this response header is returned so that the client can check for message content integrity.
If the request is to read a specified range and the x-ms-range-get-content-md5 is set to true, then the request returns an MD5 hash for the range, as long as the range size is less than or equal to 4 MB.
If neither of these sets of conditions is true, then no value is returned for the Content-MD5 header.
If x-ms-range-get-content-md5 is specified without the Range header, the service returns status code 400 (Bad Request).
If x-ms-range-get-content-md5 is set to true when the range exceeds 4 MB in size, the service returns status code 400 (Bad Request).
This header returns the value that was specified for the Content-Encoding request header.
This header returns the value that was specified for the Content-Language request header.
This header is returned if it was previously specified for the file.
Returns the value that was specified for the x-ms-content-disposition header and specifies how to process the response.
The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, Content-Disposition indicates that the user-agent should not display the response, but instead show a Save As dialog.
This header uniquely identifies the request that was made and can be used for troubleshooting the request. For more information, see Troubleshooting API Operations.
Indicates the version of the File service used to execute the request.
Indicates that the service supports requests for partial file content.
A UTC date/time value generated by the service that indicates the time at which the response was initiated.
The response body contains the content of the file.
Response Status: HTTP/1.1 200 OK Response Headers: x-ms-type: File x-ms-meta-m1: v1 x-ms-meta-m2: v2 Content-Length: 11 Content-Type: text/plain; charset=UTF-8 Date: <date> ETag: "0x8CB171DBEAD6A6B" Last-Modified: <date> x-ms-version: 2015-02-21 Server: Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0
Only the account owner may call this operation.
Calling Get File over a range that does not yet have content or that has been cleared returns zeros for those bytes.
If you call Get File with no range specified, the service returns the range of bytes up to the value specified for the x-ms-content-length header. For any ranges lacking content, the service returns zeros for those bytes.
A Get File operation is allowed 2 minutes per MB to complete. Operations that take longer than 2 minutes per MB on average will time out.