renameSystemFile()

Pixelsilk API function to rename a file in the System Files tab--requires advanced-admin-access permission
Parameters:
oldName: the old name of the file
newName: the new name of the file

Output:
The function renameSystemFile returns void.

C# Example:
string oldName= "oldFileName";
string newName = "newFileName";
RenameSystemFile(oldName, newName);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/renameSystemFile HTTP/1.1
HOST: www.example.com
Content-Length: 138
Content-Type: application/x-www-form-urlencoded
Cookie: auth=B26A9B1FECDC...27812D7F4FB3

Request Data:
Unencoded Data:
json={
   "oldName":"test.txt",
   "newName":"testing.txt"
}&token=7AdbNHZQBtwc...RPTEK8UvSUQ=

Url-encoded Data:
json=%7b%0d%0a+++...%22%0d%0a%7d&token=7AdbNHZQBtwc...TEK8UvSUQ%3d

Response Headers:
HTTP/1.1 200 OK
Set-Cookie: auth=4C8DE6A56FF5...96BD7AC700B; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 2

Response Data:
{}

JavaScript Example:
Method Call:
pixelsilk2.renameSystemFile(input, callback);

Input Object:
{
    oldName:"site test.txt",
    newName:"systemTest.txt"
}

Returned Data:
{}

Back to Files »