.Replaced $file!==false with $file->upload.