updateSystemFile()

Pixelsilk API function to edit a system file--requires the advanced-admin-access permission
Parameters:
filename: the name of the file
text: the content to update the file with

Output:
The function updateSystemFile returns void.

C# Example:
string filename = "fileName";
string text = <new content>;
UpdateSystemFile(filename, text);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/updateSystemFile HTTP/1.1
HOST: www.example.com
Content-Length: 224
Content-Type: application/x-www-form-urlencoded
Cookie: auth=8AB692E07D1C...C859B04A2905

Request Data:
Unencoded Data:
json={
   "filename":"test.txt",
   "text":"This is the content of the file test.txt. 
      It has now been altered by the updateSystemFile function."
}&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=CDEFB2D42504...E82C27B942B; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 2

Response Data:
{}

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

Input Object:
{
    filename:"site test.txt",
    text:"updated text content for system file"
}

Returned Data:
{}

Back to Files »