Most likely you were given this code or grabbed it off the internet somewhere and you didn’t even look at
the code. The message you are receiving is from this line;
$errors[] = "The file type is not allowed, only allowed .mp4, .ogg and .mov";
So, as you see this error message mentions .mov types. But, that does not mean that your code is set
up for that type, it just means it is mentioned inside the text of the error message. The follow section of
your code sets up the internal values that are valid for your uploads:
$videoacceptable = array(
“video/mp4”,
“video/ogg”,
“video/quicktime”,
);
In this code there is no actual code for generic .mov files. there is one for Quicktime files, but, that is most
likely not an exact match for your video you are trying to upload. Now, how to debug this issue. First, I
would just alter these lines at 60-61 and add some further help to the error message. The old lines:
} elseif(!in_array($videotype, $videoacceptable)) {
$errors[] = “The file type is not allowed, only allowed .mp4, .ogg and .mov”;
Would become this version with the added debugging code displayed:
} elseif(!in_array($videotype, $videoacceptable)) {
$errors[] = "The file type is not allowed, only allowed .mp4, .ogg and .mov
Your file type was: " . $videotype . “
”;
What this will do for you is to show the bad file type and you can just add it to the list of valid ones.
Should help you sort it out!
Oh, also, this is a big issue in larger sites. Error messages should show just enough info for the users
needs not the programmers. Since this is an error message, you could add a logging feature to your site
that would create a log for the webmaster showing that some user attempted to load this file with this
type of data. In that way, you can fix these issues without having to have the user let you know there
was a bad file type they needed uploaded. Hope that makes sense… Good luck!