la butto li... non ho testato, ma non si sa mai... prova a costituire
if (!empty($_FILES["file"])) {

con

if ($_FILES[file]) {