cURL Upload File to PHP
Your $_FILES["file"]["type"]
check is failing because cURL doesn't make any guesses to the type and won't send that automatically in the POST request.
This is easily spoofed so it's not a great check anyway.
But to make your example work, try specifying the content type with the file parameter:
curl -F file=@test.mp4;type=video/mp4 http://localhost:1337/upload_file.php