\Drupal::messenger()->addError(t('File upload error. Could not move uploaded file.'));
\Drupal::logger('file')->notice('Upload error. Could not move uploaded file %file to destination %destination.',['%file'=>$uploaded_file->getClientOriginalName(),'%destination'=>$destination.'/'.$uploaded_file->getClientOriginalName()]);
$files[$i]=FALSE;
}
catch(FileException$e){
\Drupal::messenger()->addError(t('The file %filename could not be uploaded because the name is invalid.',['%filename'=>$uploaded_file->getClientOriginalName()]));
@trigger_error(__METHOD__.'() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\file\Upload\FileUploadHandler::handleFileUpload() instead. See https://www.drupal.org/node/3239547',E_USER_DEPRECATED);
$user=\Drupal::currentUser();
// Remember the original filename so we can print a message if it changes.