i have a problem of uploading files to Dropbox, this is the error i get
[WebService::Dropbox] [ERROR] https://content.dropboxapi.com/2/files/u +pload {"path":"/Uploads/$filename"} -> [400] Error in call to API fun +ction "files/upload": Must provide HTTP header "Authorization" or URL + parameter "authorization". at WebService/Dropbox.pm line 184.
My full code
#!/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 $loc +al_file: $!"; my $result = $dropbox->upload($remote_path, $content); if ($result) { print "Successfully uploaded $local_file to Dropbox as $remote_pat +h\n"; } else { die "Upload failed: " . $dropbox->error; }
In reply to Dropbox problem by frank1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |