I am trying to take an image by the primary camera, but when I send it from the mobile and try to display it show me "404 Not found on this server". In addition, when capturing by the secondary camera there is no problem.
Could any one help me to resolve it?
<?php
if(isset($_FILES['image'])&& isset($_POST['Meter_Type'])&& isset($_POST['Current_Reading'])&& isset($_POST['Date'])){
$errors= array();
// Identifying the image name,size, type and the temporary text.
$file_name = $_FILES['image']['name'];
$file_size =$_FILES['image']['size'];
$file_tmp =$_FILES['image']['tmp_name'];
$file_type=$_FILES['image']['type'];
$file_ext=strtolower(end(explode('.',$_FILES['image']['name'])));
$expensions= array("jpeg","jpg","png");
if(in_array($file_ext,$expensions)=== false){
$errors[]="extension not allowed, please choose a JPEG or PNG file.";
}
if($file_size > 6291456){
$errors[]='File size must be excately 2 MB';
}
if(empty($errors)==true){
//Identifying the directory that is used to upload image file.
move_uploaded_file($file_tmp,"/home/ar/Web/Mobile/images/".$file_name) ;
echo "Success";
}else{
print_r($errors);
}
}
}
?>
Aucun commentaire:
Enregistrer un commentaire