score:2

Accepted answer

The problem is probably related to the permissions of the JSON file you created. Check if it has read permissions (for everyone, not only the file's owner).

If not (which is probably the case), put this at the end of your PHP function creating the file, under fclose($out):

chmod($tmpFile, 0644); # Read/write for file owner, read for everyone else

It needs to be readable by everyone since JavaScript is executed client-side and not server-side.


Related Articles