It is working perfectly fine on local but on live server image and video both are not uploading, and i also don’t have the access of the live server to debug things on live. i tried many time logs and many things but nothing working can anyone help me solve this problem.
$limit = (!empty($_POST['limit']) && is_numeric($_POST['limit']) && $_POST['limit'] > 0 && $_POST['limit'] <= 50 ? Wo_Secure($_POST['limit']) : 20);
$after_post_id = (!empty($_POST['after_post_id']) &&
is_numeric($_POST['after_post_id']) && $_POST['after_post_id'] > 0 ?
Wo_Secure($_POST['after_post_id']) : 0);
if (!empty($_POST['type']) && in_array($_POST['type'], $required_fields)) {
if ($_POST['type'] == 'create') {
if (!empty($_POST['post_id']) && is_numeric($_POST['post_id']) && $_POST['post_id'] > 0) {
$post_data = Wo_PostData($_POST['post_id']);
if(empty($post_data)){
$error_code = 7;
$error_message = 'Post not exist.';
}
elseif (!empty($_FILES['image']) || !empty($_POST['text'])) {
$page_id = '';
if (!empty($_POST['page_id'])) {
$page_id = $_POST['page_id'];
}
$comment_image = '';
if (isset($_FILES['image']['name'])) {
$fileInfo = array(
'file' => $_FILES["image"]["tmp_name"],
'name' => $_FILES['image']['name'],
'size' => $_FILES["image"]["size"],
'type' => $_FILES["image"]["type"]
);
$media = Wo_ShareFile($fileInfo);
if (!empty($media)) {
$comment_image = $media['filename'];
}
}
if (empty($comment_image) && empty($_POST['text'])) {
header("Content-type: application/json");
echo json_encode($data);
exit();
}
$text_comment = '';
if (!empty($_POST['text']) && !ctype_space($_POST['text'])) {
$text_comment = $_POST['text'];
}
$C_Data = array(
'user_id' => Wo_Secure($wo['user']['user_id']),
'page_id' => Wo_Secure($page_id),
'post_id' => Wo_Secure($_POST['post_id']),
'text' => Wo_Secure($_POST['text']),
'c_file' => Wo_Secure($comment_image),
'time' => time()
);
$R_Comment = Wo_RegisterPostComment($C_Data);
$comment = Wo_GetPostComment($R_Comment);
if (!empty($comment['publisher'])) {
foreach ($non_allowed as $key4 => $value4) {
unset($comment['publisher'][$value4]);
}
}
if (!empty($text_comment)) {
$comment['text'] = $text_comment;
}
if (empty($comment['replies'])) {
$comment['replies'] = 0;
}
$response_data = array(
'api_status' => 200,
'data' => $comment
);
$tmp_test_array = array(
'fileinfo' => json_encode($fileInfo),
'comment_image' => json_encode($comment_image),
'text' => json_encode($text_comment),
'c_data' => json_encode($C_Data),
'R_commment' => json_encode($R_Comment),
'comment' => json_encode($comment),
'response' => json_encode($response_data),
'media' => json_encode($media)
);
hasAccess($tmp_test_array);
}
else{
$error_code = 5;
$error_message = 'Please check your details.';
}
}
else{
$error_code = 6;
$error_message = 'post_id can not be empty.';
}
}
here is my code please help me to figure out the solution of the problem.