if ($_REQUEST['device_type'] == '1') {
$fileName = $_FILES['media_chunk']['name'];
$tmpName = $_FILES['media_chunk']['tmp_name'];
//$fileSize = $_FILES['imageData']['size'];
//$fileType = $_FILES['imageData']['type'];
$fp = fopen($tmpName, 'r');
$content = fread($fp, filesize($tmpName));
$content1 = addslashes($content);
fclose($fp);
$file_name = $db->host . 'snaps/' . $_REQUEST['media_name']; // . $owner_id
$file_to_open = 'snaps/' . $_REQUEST['media_name'];
$handle = fopen($file_to_open, 'a');
fwrite($handle, $content);
fclose($handle);
$msg = new getErrorMsg('0');
$json = array('FilePath' => $file_name, 'statusMessage' => $msg->errMsg, 'statusNumber' => $msg->errNo);
echo json_encode($json);
return false;
The data isn't being uploaded through device. Works when I fill out form from desktop but not through iPhone.
Path is created however just not the data