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

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:
   "text":"This is the content of the file test.txt. 
      It has now been altered by the updateSystemFile function."

Url-encoded Data:

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 »