use strict; use warnings; use LWP::UserAgent; ### hole Daten binär my $filename = 'test.txt'; my $content; { #slurp mode $/ = undef; open (my $fh, '<', $filename) or die $!; binmode $fh; $content = <$fh>; close $fh; } ### Erzeuge Client my $ua = LWP::UserAgent->new; $ua->agent("MyApp/0.1 "); my $url = 'https://webdav.mediencenter.t-online.de/' . "$filename"; # Authentifizierung, https://metacpan.org/pod/distribution/libwww-perl/lwptut.pod#HTTP-Authentication $ua->credentials( 'webdav.mediencenter.t-online.de:443', # Domain:Port 'webdav-ng', # Authentication realm 'xxx-yyyyyyyyyyyy@t-online.de' => 'test123' # Loginname, Passwort ); # PUT-Request absenden my $res = $ua->put($url, content => $content ); if ( $res->is_success ) { #print $res->content; } else { print $res->status_line, "\n"; }