v1

latestSwagger 2.02026-07-13125103.0 KB
File and Directory Operations

Create File | Create Directory | Rename File | Rename Directory

Create or rename a file or directory. By default, the destination is overwritten and if the destination already exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see Specifying Conditional Headers for Blob Service Operations. To fail if the destination already exists, use a conditional request with If-None-Match: "*".

put/{filesystem}/{path}

Query parameters

resource'directory' | 'file'

Required only for Create File and Create Directory. The value must be "file" or "directory".

continuationstring

Optional. When renaming a directory, the number of paths that are renamed with each invocation is limited. If the number of paths to be renamed exceeds this limit, a continuation token is returned in this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the rename operation to continue renaming the directory.

mode'legacy' | 'posix'

Optional. Valid only when namespace is enabled. This parameter determines the behavior of the rename operation. The value must be "legacy" or "posix", and the default value will be "posix".

Headers

Cache-Controlstring

Optional. The service stores this value and includes it in the "Cache-Control" response header for "Read File" operations for "Read File" operations.

Content-Encodingstring

Optional. Specifies which content encodings have been applied to the file. This value is returned to the client when the "Read File" operation is performed.

Content-Languagestring

Optional. Specifies the natural language used by the intended audience for the file.

Content-Dispositionstring

Optional. The service stores this value and includes it in the "Content-Disposition" response header for "Read File" operations.

x-ms-cache-controlstring

Optional. The service stores this value and includes it in the "Cache-Control" response header for "Read File" operations.

x-ms-content-typestring

Optional. The service stores this value and includes it in the "Content-Type" response header for "Read File" operations.

x-ms-content-encodingstring

Optional. The service stores this value and includes it in the "Content-Encoding" response header for "Read File" operations.

x-ms-content-languagestring

Optional. The service stores this value and includes it in the "Content-Language" response header for "Read File" operations.

x-ms-content-dispositionstring

Optional. The service stores this value and includes it in the "Content-Disposition" response header for "Read File" operations.

x-ms-rename-sourcestring

An optional file or directory to be renamed. The value must have the following format: "/{filesystem}/{path}". If "x-ms-properties" is specified, the properties will overwrite the existing properties; otherwise, the existing properties will be preserved. This value must be a URL percent-encoded string. Note that the string may only contain ASCII characters in the ISO-8859-1 character set.

x-ms-lease-idstring

Optional. A lease ID for the path specified in the URI. The path to be overwritten must have an active lease and the lease ID must match.

x-ms-source-lease-idstring

Optional for rename operations. A lease ID for the source path. The source path must have an active lease and the lease ID must match.

x-ms-propertiesstring

Optional. User-defined properties to be stored with the file or directory, in the format of a comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is a base64 encoded string. Note that the string may only contain ASCII characters in the ISO-8859-1 character set.

x-ms-permissionsstring

Optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each class may be granted read, write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are supported.

x-ms-umaskstring

Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766).

If-Matchstring

Optional. An ETag value. Specify this header to perform the operation only if the resource's ETag matches the value specified. The ETag must be specified in quotes.

If-None-Matchstring

Optional. An ETag value or the special wildcard ("*") value. Specify this header to perform the operation only if the resource's ETag does not match the value specified. The ETag must be specified in quotes.

If-Modified-Sincestring

Optional. A date and time value. Specify this header to perform the operation only if the resource has been modified since the specified date and time.

If-Unmodified-Sincestring

Optional. A date and time value. Specify this header to perform the operation only if the resource has not been modified since the specified date and time.

x-ms-source-if-matchstring

Optional. An ETag value. Specify this header to perform the rename operation only if the source's ETag matches the value specified. The ETag must be specified in quotes.

x-ms-source-if-none-matchstring

Optional. An ETag value or the special wildcard ("*") value. Specify this header to perform the rename operation only if the source's ETag does not match the value specified. The ETag must be specified in quotes.

x-ms-source-if-modified-sincestring

Optional. A date and time value. Specify this header to perform the rename operation only if the source has been modified since the specified date and time.

x-ms-source-if-unmodified-sincestring

Optional. A date and time value. Specify this header to perform the rename operation only if the source has not been modified since the specified date and time.

Response

The file or directory was created.