On Wed, May 30, 2012 at 12:48 AM, Jools Wills <buzz@exotica.org.uk> wrote:
On 29/05/12 23:41, nguyenkim thuat wrote:
I just know the version of my mediawiki.
it's 1.15.5-1

ok so you cant use the "edit" function then - thats for 1.16 and greater. 1.15 is very old.

Check which version of the cpan mediawiki::api module also - you should get the latest (0.39)

Best Regards

Jools
My mediawiki version now is:
MediaWiki 1.19.0
PHP 5.3.3-1ubuntu9.10 (apache2handler)
SQLite 3.7.2 with full-text search support

I use the api->edit as your suggestions but it generated an error.
The code is:
 $mediawiki->edit( {
                action => 'upload',
                filename => $name,
                comment => 'upload a file',
                file => [$name],
                ignorewarnings => 1,
                bot => 1
                } ) || die $mediawiki->{error}->{code} . ': ' . $mediawiki->{error}->{details};

Logged in with user "WikiAdmin".
22 bytes read
5: Unable to get an edit token for action 'upload'. at upload.pl line 35.


So i do need to get a token before uploading a file with this newest version of mediawiki?