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
https://forums.phpfreaks.com/topic/86101-upload-video-please-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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