nicht hochgeladene Datei abfangen
authorSven Schöling <s.schoeling@linet-services.de>
Mon, 19 Nov 2012 09:38:54 +0000 (10:38 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Fri, 11 Jan 2013 12:58:30 +0000 (13:58 +0100)
SL/Controller/CsvImport.pm

index 8834b20..23f3332 100644 (file)
@@ -250,6 +250,12 @@ sub test_and_import_deferred {
     $file->fh->close;
   }
 
+  my $file = SL::SessionFile->new($self->csv_file_name, mode => '<', encoding => $self->profile->get('charset'));
+  if (!$file->fh) {
+    flash('error', $::locale->text('No file has been uploaded yet.'));
+    return $self->action_new;
+  }
+
   $self->{background_job} = SL::BackgroundJob::CsvImport->create_job(
     file    => $self->csv_file_name,
     profile => $self->profile,