PUT /files
Description
Moves or copies a single or multiple files to a specified locationThe route handles the HTTP PUT request made to the /files
path.
Payload
The server needs to receive a JSON object with the next parameters:
operation
(string) - (required) the operation name which can be "copy" or "move"target
(string) - (required) the path to a folder where to move/copy filesids
(array) - (required) ids of files and/or folders to be moved/copied (which are paths to files and folders)
Example:
{
operation: "move",
target: "/Code",
ids: ["/Music", "/Cards"]
}
Response
The server returns a JSON object with the result array of moved/copied files (with a new id and new name for each file)
Example:
{
result:
[
{
id: "/Code/Music",
name:"/Music"
},
{
id: "/Code/Cards",
name:"/Cards"
},
]
}
The HTTP status code shows whether the request succeeds (response.status == 200) or fails (response.status == 500). In case of a failure the error text is returned.
Related articles: