Subject: | api upload issue |
The method API upload seems broken, it always requires a token similar to this, I cal call this method between two $wm->edit() calls and the edits will work fine, if I remove the token and the die() the function will ... "3: notoken: The token parameter must be set at"
$mw->api( {
action => 'upload',
token => $mw->{'config'}->{'tokens'}->{'edit'},
ignorewarnings => 1,
filename => $imgtitle,
comment => '[[Category:Portraits]][[Category:Clipart]]',
file => [ undef, $imgtitle, Content => $imgdata ],
} )
|| die $mw->{error}->{code} . ': ' . $mw->{error}->{details};