I use a simple script to allow a user to upload video files.
<form action="" method="post" enctype="multipart/form-data">
File: <input type="file" name="file" />
<br /><br />
<input type="submit" name="x" value="Upload">
<input type="hidden" name="submit" value="1">
</form>
<?PHP
if( isset( $POST['submit'] ) )
{
if( $FILES['file']['tmp_name'] != '' )
{
if( move_uploaded_file( $FILES['file']['tmp_name'], $upload_dir . '/' . $FILES['file']['name'] ) )
echo 'The file has been succesfully uploaded.';
else
echo 'Could not upload file.';
}
else
die( 'You have to choose a file!' );
}
?>
The problem I have is that the end user is unreliable and uploads files as either .wmv or .WMV.
What I would like to do is to change the file type to lower case when the file is upoaded, but my limited PHP skill doesn't stretch to knowing how to do this. I have searched but cannot find a suitable solution.
I have tried to use mb_strtolower and strtolower but neither worked with my feeble attempt.
Could someone please show me how to do this.
Kind regards
PHPDeano