mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 06:38:58 +08:00
Handle OctoPrint upload of files having Unicode characters in filename or path. #2827
This commit is contained in:
parent
56b993bb89
commit
854be6a186
@ -1230,13 +1230,15 @@ sub send_gcode {
|
||||
my $ua = LWP::UserAgent->new;
|
||||
$ua->timeout(180);
|
||||
|
||||
my $path = Slic3r::encode_path($self->{send_gcode_file});
|
||||
my $res = $ua->post(
|
||||
"http://" . $self->{config}->octoprint_host . "/api/files/local",
|
||||
Content_Type => 'form-data',
|
||||
'X-Api-Key' => $self->{config}->octoprint_apikey,
|
||||
Content => [
|
||||
# OctoPrint doesn't like Windows paths
|
||||
file => [ $self->{send_gcode_file}, basename($self->{send_gcode_file}) ],
|
||||
# OctoPrint doesn't like Windows paths so we use basename()
|
||||
# Also, since we need to read from filesystem we process it through encode_path()
|
||||
file => [ $path, basename($path) ],
|
||||
],
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user