On my site the user will upload a video or audio. Earlier you guys helped me with a small script to extract the file extention. I also have the script to do the uploading of the file but I am not sure how to incorporate the file extention script in the upload script. I will include my 2 scripts.
UPLOAD SCRIPT
(the extention. wmv below will be replaced with a variable holding the proper extention)
$vid_file = $session[USERNAME].$id.".wmv";
$numoffile = 1;
$file_dir = " /var/www/html/comedy/comicvids/";
if ($POST) {
for ($i=0;$i<$numoffile;$i++) {
if (trim($FILES['myfiles']['name'][$i])!="") {
$newfile = $file_dir.$FILES['myfiles']['name'][$i];
$newfile = "/var/www/html/comedy/comicvids/$vid_file";
move_uploaded_file($FILES['myfiles']['tmp_name'][$i], $newfile);
$j++;
FIND THE FILE EXTENTION SCRIPT
$path_parts = pathinfo('/www/htdocs/index.mpg');
echo $path_parts['extension'], "\n";
I dont want to print the extention, just put it in a variable then fit it in to the above upload script.
I am fairly new at PHP and sometimes this stuff I need to do is over my head and I appreciate all your help!!