[ad_1]
i’m working on app that takes a shot from the camera and upload the picture to the server so this is my code:-
<form id="theform" action="upload.php" onsubmit="event.preventDefault(); return myFunction();" method="post" enctype="multipart/form-data">
<input id="file" name="uploadedFile" onchange="uptoserver();" style="display:none;"type="file" accept="image/*" capture="camera">
<div class="row justify-content-center">
<button type="submit" class="btn wbtn border rounded-pill" style="font-family:Hana; font-size:32px;">
<img src="style\image\camera.png" width="64" /> تصوير النمودج
</button>
</div>
</form>
and upload.php :-
<?php
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['uploadedFile']['name']);
if(move_uploaded_file($_FILES['uploadedFile']['tmp_name'], $target_path)) {
echo "جاري إضافة الملف ". basename( $_FILES['uploadedFile']['name']).
" إلى جدول ملف إكسل";
echo "<script>document.write(readfile(\"".$target_path."\"));</script>";
$stringPath = $target_path; //PASSING NAME PARAM
// how can i pass the Name to prepare.php
printf($stringPath);
} else{
echo "There was an error uploading the file, please try again!";
}
?>
the problem is that this upload script is uploading the picture but its corrupted file with size of 0mb so how can i fix this problem
[ad_2]