<?php $file = $_SERVER['DOCUMENT_ROOT'] . '/concept/bower_components/bootstrap/mobile/logfile.txt'; file_put_contents($file, json_encode($_FILES), FILE_APPEND); // file_put_contents ( $file, json_encode($_POST), FILE_APPEND ); require "../API/addAudio.php"; require "../API/uploadAudio.php"; if (!empty($_POST) && $_POST['user_id'] != null) { $retObj = uploadAudio($_FILES['file']['tmp_name']); if ($retObj['success']) { addAudio($_POST['user_id'], $retObj['path'], $_POST['method']); } }
error_log(print_R("- Malformed UTF-8 characters, possibly incorrectly encoded:\n ", TRUE), 3, LOG); $response["error"] = true; $response["message"] = "Failed to upload. Please try again"; echoRespnse(400, $response); break; default: error_log(print_R("- Unknown error:\n ", TRUE), 3, LOG); $response["error"] = true; $response["message"] = "Failed to upload. Please try again"; echoRespnse(400, $response); break; } $isAudio = isset($dataJsonDecode->audio) ? $dataJsonDecode->audio : ""; if ($isAudio != "") { //we could have multiple records. If end up with 0, all was good $thesuccess += uploadAudio(json_decode($data, true), $thehive); } $isHive = isset($dataJsonDecode->hive) ? $dataJsonDecode->hive : ""; if ($isHive != "") { $thesuccess += uploadHive(json_decode($data, true), $thehive); } $isPopulation = isset($dataJsonDecode->population) ? $dataJsonDecode->population : ""; if ($isPopulation != "") { $thesuccess += uploadPopulation(json_decode($data, true), $thehive); } $isFrameWeight = isset($dataJsonDecode->frameweight) ? $dataJsonDecode->frameweight : ""; if ($isFrameWeight != "") { $thesuccess += uploadFrameWeight(json_decode($data, true), $thehive); } $isLightHistory = isset($dataJsonDecode->lighthistory) ? $dataJsonDecode->lighthistory : ""; if ($isLightHistory != "") {