Skip to content

Commit

Permalink
Handle OctoPrint upload of files having Unicode characters in filenam…
Browse files Browse the repository at this point in the history
…e or path. #2827
  • Loading branch information
alranel committed Jun 2, 2015
1 parent 56b993b commit 854be6a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Slic3r/GUI/Plater.pm
Expand Up @@ -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) ],
],
);

Expand Down

0 comments on commit 854be6a

Please sign in to comment.