Bugzilla – Attachment 188118 Details for
Bug 38115
Add FTP support to export_records.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38115: (follow-up) Use File::Basename to extract filename for remote upload
b672208.patch (text/plain), 1.64 KB, created by
Kyle M Hall (khall)
on 2025-10-17 18:03:47 UTC
(
hide
)
Description:
Bug 38115: (follow-up) Use File::Basename to extract filename for remote upload
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2025-10-17 18:03:47 UTC
Size:
1.64 KB
patch
obsolete
>From b67220865394bf90a60c27b2817384c5a063cbe7 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Fri, 17 Oct 2025 15:43:52 +0100 >Subject: [PATCH] Bug 38115: (follow-up) Use File::Basename to extract filename > for remote upload > >When --filename contains a path (e.g., /tmp/records.mrc), the script >was uploading to the remote server with the full path, creating >unwanted directory structures (e.g., uploads/tmp/records.mrc). > >This patch uses File::Basename::fileparse() to extract just the >filename portion for the remote upload, while still using the full >path for local file operations. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > misc/export_records.pl | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/misc/export_records.pl b/misc/export_records.pl >index 0a00f961640..fefa1667917 100755 >--- a/misc/export_records.pl >+++ b/misc/export_records.pl >@@ -21,6 +21,7 @@ use MARC::File::XML; > use List::MoreUtils qw( uniq ); > use Getopt::Long qw( GetOptions ); > use Pod::Usage qw( pod2usage ); >+use File::Basename qw( fileparse ); > > use Koha::Script; > use C4::Auth; >@@ -384,7 +385,9 @@ if ($file_transport) { > } > > # Upload the file >- unless ( $file_transport->upload_file( $filename, $filename ) ) { >+ # Extract just the filename from the path for remote upload >+ my ($remote_filename) = fileparse($filename); >+ unless ( $file_transport->upload_file( $filename, $remote_filename ) ) { > $file_transport->disconnect; > die sprintf( "Error: Unable to upload file '%s' to server (ID: %s)\n", $filename, $destination_server_id ); > } >-- >2.39.5 (Apple Git-154)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38115
:
178781
|
186589
|
186590
|
186855
|
186856
|
186857
|
188090
|
188091
|
188092
|
188093
|
188115
|
188116
|
188117
|
188118
|
188119
|
188120
|
188121
|
188122