aboutsummaryrefslogtreecommitdiffstats
path: root/tools/piwigo_remote.pl
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tools/piwigo_remote.pl20
1 files changed, 19 insertions, 1 deletions
diff --git a/tools/piwigo_remote.pl b/tools/piwigo_remote.pl
index 8cdd1da35..89597ed65 100644
--- a/tools/piwigo_remote.pl
+++ b/tools/piwigo_remote.pl
@@ -64,10 +64,28 @@ if ($opt{action} eq 'pwg.images.add') {
name => $opt{name},
};
- $result = $ua->post(
+ my $response = $ua->post(
$conf{base_url}.'/ws.php?partner='.$conf{partner_key}.'&format=json',
$form
);
+
+ print "-" x 50, "\n";
+ printf("response code : %u\n", $response->code);
+ printf("response message : %s\n", $response->message);
+ print "-" x 50, "\n";
+ print "\n";
+
+# use Data::Dumper;
+# print Dumper($response);
+
+ if ($response->is_success) {
+ print "upload successful\n";
+ }
+ else {
+ warn 'A problem has occured during upload', "\n";
+ warn $response->decoded_content, "\n";
+ die $response->status_line;
+ }
}
if ($opt{action} eq 'pwg.tags.list') {