You can move a file to a new sub-directory while using the "rename" action.
Example "rename" POST body
POST /[CP Code]/[path]/[file.ext] HTTP/1.1
Host: [Domain Prefix]-nsu.akamaihd.net
X-Akamai-ACS-Action: version=1&action=rename&destination=%2F[CP Code]%2F[new path]%2F[filename.ext]
[Signature Header 1]
[Signature Header 2]
[Body]
Required variables
[CP code]
. The unique CP code that represents the root directory in the applicable NetStorage Storage Group.[path]
. Any sub-directories off of the CP Code root, that are to serve as parents of the new directory (if applicable).[file.ext]
. The target file or symlink to be moved (and optionally renamed).
If the specified object does not exist, an HTTP 404 “Not Found” error is returned.
[Domain Prefix]
. This is the unique domain prefix set up for the storage group during its creation. It can be viewed in the NetStorage Groups UI in PORTAL_NICKNAME.[Signature Header 1]
and[Signature Header 2]
. Applicable signature headers.[Body]
. You must also include an applicable request[Body]
, which is the case with any “PUT” or “POST” action.
Action header field variables
This action has one required action header field, and its variables need to be populated based on the desired move operation:
rename&destination=/[CP Code]/[path]/[file.ext]
. Include the[CP Code]
root, followed by the[path]
destination where the renamed file is to reside. Finally, include the new name[file.ext]
for the object and include the extension, if applicable. Ensure that special characters are query string encoded as required. For example, any forward slashes ("/") would need to be represented as%2F
, in support of query string encoding.
Move, Only
rename&destination=/[CP Code]/[path]/[file.ext]
. Include the[CP Code]
root, followed by the complete path to the new destination as the[path]
. Finally, include the existing file name for the object (and its associated extension) as the[file.ext]
. Ensure that special characters are query string encoded. For example, any forward slashes ("/") would need to be represented as%2F
, in support of query string encoding.
Move and Rename
rename&destination=/[CP Code]/[path]/[file.ext]
. Include the[CP Code]
root, followed by the complete path to the new destination as the[path]
. Finally, include the new file name for the object (and its associated extension) as the[file.ext]
. Ensure that special characters are query string encoded. For example, any forward slashes ("/") would need to be represented as%2F
, in support of query string encoding.
All filesystem logic applies to renaming or moving a file or symlink.