Jump to content
Sign in to follow this  
FrankGalos

mpeg files uploading php 5 .6 support

Recommended Posts

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 by FrankGalos

Share this post


Link to post
Share on other sites

Have you considered showing us the code so we don't have to make blind guesses?

Edited by requinix

Share this post


Link to post
Share on other sites

<?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>

Share this post


Link to post
Share on other sites

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'] ?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.