Lines 100-108
sub plugin {
Link Here
|
100 |
my $fh = $input->upload('uploaded_file'); |
100 |
my $fh = $input->upload('uploaded_file'); |
101 |
|
101 |
|
102 |
$id = C4::UploadedFiles::UploadFile($uploaded_file, $dir, $fh->handle); |
102 |
$id = C4::UploadedFiles::UploadFile($uploaded_file, $dir, $fh->handle); |
103 |
if($id) { |
103 |
my $OPACBaseURL = C4::Context->preference('OPACBaseURL') // ''; |
104 |
my $OPACBaseURL = C4::Context->preference('OPACBaseURL'); |
104 |
$OPACBaseURL =~ s#/$##; |
105 |
$OPACBaseURL =~ s#/$##; |
105 |
if (!$OPACBaseURL) { |
|
|
106 |
$template->param(MissingURL => 1); |
107 |
} |
108 |
if($id && $OPACBaseURL) { |
106 |
my $return = "$OPACBaseURL/cgi-bin/koha/opac-retrieve-file.pl?id=$id"; |
109 |
my $return = "$OPACBaseURL/cgi-bin/koha/opac-retrieve-file.pl?id=$id"; |
107 |
$template->param( |
110 |
$template->param( |
108 |
success => 1, |
111 |
success => 1, |