getSystemFile()

Pixelsilk API function to get the contents of a system file--requires the advanced-admin-access permission
Parameters:
filename: the name of the file

Output:
The function getSystemFile returns a string containing the contents of the file

C# Example:
string filename = "fileName";
string fileContents = GetSystemFile(filename);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/getSystemFile HTTP/1.1
HOST: www.example.com
Content-Length: 94
Content-Type: application/x-www-form-urlencoded
Cookie: auth=EA287F441E1B...DE1F82451129

Request Data:
Unencoded Data:
json={
   "filename":"test.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=366CFCE9A6F9...8339D058868; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 43

Response Data:
"This is the content of the file test.txt."

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

Input Object:
{
    filename:"site test.txt"
}

Returned Data:
"text content for system file\n"

Back to Files »