FrankGalos Posted August 14, 2015 Share Posted August 14, 2015 (edited) Hello i m trying to upload video files using AMPPS server with php 5.6 in it but when i uploads it gives me an error report in file that i uploading , and when i uploads an image file it upload with no error so i don't understand why it doesn't uploading videos/audios . please help if you have an clue in this thing Edited August 14, 2015 by FrankGalos Quote Link to comment Share on other sites More sharing options...
requinix Posted August 15, 2015 Share Posted August 15, 2015 (edited) Have you considered showing us the code so we don't have to make blind guesses? Edited August 15, 2015 by requinix Quote Link to comment Share on other sites More sharing options...
FrankGalos Posted August 15, 2015 Author Share Posted August 15, 2015 <?php if(isset($_POST['submit'])){ echo $file = $_FILES['vm']['name']; $type = $_FILES['vm']['type']; $size = $_FILES['vm']['size']; echo $error= $_FILES['vm']['error']; $file_loc = $_FILES['vm']['tmp_name']; $path = 'uploads/'; if(!empty($file)){ if(preg_match('/\.(mp4|webm|ogg|mp3|jpg)$/i',$file)){ if($error === 0){ if(move_uploaded_file($file_loc,$path.$file)){ echo 'uploading successfuly'; }else{ echo 'upload failed'; die(); } }else{ echo('error in file'); } } }else{ echo 'file can not be empty'; die(); } } ?> <form action="filehandler.php" method="post" enctype='multipart/form-data'> file<input type = 'file' name='vm' ><input type="submit" name="submit" value="submit"> </form> Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted August 16, 2015 Share Posted August 16, 2015 it would have also helped if you had told us what error message you are getting from your code and what you got when you echoed $error= $_FILES['vm']['error'] ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.