Jump to content

Upload video??? please help


inwonder

Recommended Posts

hi,

i'm new in php so any reference regarding it will be a great help.

i have this script for loading files i can load images but not videos

anyone know what should i do to upload video.

here is my current code:

 

 

$MAXIMUM_FILE_COUNT = 10;

 

    move_uploaded_file($_FILES['Filedata']['tmp_name'], "./temporary/".$_FILES['Filedata']['name']);

 

$directory = opendir('./images/');

$files = array();

while ($file = readdir($directory))

{

    array_push($files, array('./images/'.$file, filectime('./images/'.$file)));

}

usort($files, sorter);

if (count($files) > $MAXIMUM_FILE_COUNT)

{

    $files_to_delete = array_splice($files, 0, count($files) - $MAXIMUM_FILE_COUNT);

    for ($i = 0; $i < count($files_to_delete); $i++)

    {

        unlink($files_to_delete[$i][0]);

    }

}

print_r($files);

closedir($directory);

 

function sorter($a, $b)

{

    if ($a[1] == $b[1])

    {

        return 0;

    }

    else

    {

        return ($a[1] < $b[1]) ? -1 : 1;

    }

}

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.

×
×
  • 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.