[WebService::Dropbox] [ERROR] https://content.dropboxapi.com/2/files/upload {"path":"/Uploads/$filename"} -> [400] Error in call to API function "files/upload": Must provide HTTP header "Authorization" or URL parameter "authorization". at WebService/Dropbox.pm line 184. #### #!/usr/bin/perl use lib '.'; use strict; use warnings; use WebService::Dropbox; use IO::File; my $filename = '/var/www/vhosts/path/httpdocs/path/file.txt'; my $access_token = ''; my $dropbox = WebService::Dropbox->new({ key => $access_token, # oauth2 is true by default for recent versions }); my $local_file = $filename; my $remote_path = '/Uploads/$filename'; my $content = IO::File->new($local_file, '<') or die "Cannot open $local_file: $!"; my $result = $dropbox->upload($remote_path, $content); if ($result) { print "Successfully uploaded $local_file to Dropbox as $remote_path\n"; } else { die "Upload failed: " . $dropbox->error; }