@@ -, +, @@ upload-file.pl --- Koha/Upload.pm | 17 +++++++++-------- tools/upload-file.pl | 3 ++- 2 files changed, 11 insertions(+), 9 deletions(-) --- a/Koha/Upload.pm +++ a/Koha/Upload.pm @@ -211,10 +211,7 @@ sub delete { return @res; } -sub DESTROY { -} - -# ************** HELPER ROUTINES / CLASS METHODS ****************************** +=head1 CLASS METHODS =head2 getCategories @@ -243,7 +240,9 @@ sub httpheaders { ); } -# ************** INTERNAL ROUTINES ******************************************** +=head1 INTERNAL ROUTINES + +=cut sub _init { my ( $self, $params ) = @_; @@ -310,9 +309,11 @@ sub _full_fname { my ( $self, $rec ) = @_; my $p; if( ref $rec ) { - $p= $rec->{permanent}? $self->{rootdir}: $self->{tmpdir}; - $p.= '/'; - $p.= $rec->{dir}. '/'. $rec->{hashvalue}. '_'. $rec->{filename}; + $p = File::Spec->catfile( + $rec->{permanent}? $self->{rootdir}: $self->{tmpdir}, + $rec->{dir}, + $rec->{hashvalue}. '_'. $rec->{filename} + ); } return $p; } --- a/tools/upload-file.pl +++ a/tools/upload-file.pl @@ -81,7 +81,8 @@ sub send_reply { # response will be sent back as JSON }); } -sub upload_pars { +sub upload_pars { # this sub parses QUERY_STRING in order to build the + # parameter hash for Koha::Upload my ( $qstr ) = @_; $qstr = Encode::decode_utf8( uri_unescape( $qstr ) ); # category could include a utf8 character --