I am trying to use the Transendit.com service with Codeigniter. Currently I am trying to build the notify page. I can receive the POST request (in JSON format) and write it to a file. The strange thing is that I cannot parse the JSON object to a PHP array so that I can extract relevant data from it. When I decode it before writing to the file the file is empty. If I don´t the JSON code is written to the file.
This is my controller code:
$result = $_POST['transloadit'];
$result = json_decode($result); // This produces empty content in file
$this->load->helper('file');
if ( ! write_file('./files/myfile.php', $result))
{
echo 'Unable to write the file';
} else {
echo 'File written!';
}
The JSON object that is sent to the page can be found here: http://pastie.org/3056727