Manual talk:Pywikibot/upload.py

403 Forbidden error
Hi,

When I try to upload an image using this script I get a 403 Forbidden page back. Manually uploading using the bot user account works and editing an article using the editarticly.py script works to. Anybody knows why upload.py does not work? I'm running Mediawiki 1.6.3 and am using the newest upload.py available. thnx --GrandiJoos 18:16, 1 May 2006 (UTC)

An Idea
GrandiJoos - You should be able to get information about why the page is forbidden by checking the server logs. These should be available through your web hosting service, and are automatically kept by the web server program (like Apache). In general there are two reasons for a 403 error: wrong permissions on the file, or wrong un/pw. If you are able to access your wiki when you log in, then you are probably requesting a nonexistent file. The server logs should record every file that was requested by a client that it couldn't find.

Also, make sure you check the path specified by grandijooswiki_family.py (or whatever_family.py) is accurate. This is the default:

def path(self, code): return '/wiki/index.php'

And if your wiki is in the root folder of your server, you might need this:

def path(self, code): return '/index.php'

Hope that helps

Ioneil 22:05, 20 May 2006 (UTC)

'utf8' Can't Decode Byte
I am able to log in without any problems, but when I try to upload any image (using URL or local file) to the server, I get the following error message:

Traceback (most recent call last): File "C:\Documents and Settings\Jim\My Documents\Downloads\Applications\Python WikiBot\pywikipedia\upload.py", line 251, in ? main(sys.argv[1:]) File "C:\Documents and Settings\Jim\My Documents\Downloads\Applications\Python WikiBot\pywikipedia\upload.py", line 247, in main bot.run File "C:\Documents and Settings\Jim\My Documents\Downloads\Applications\Python WikiBot\pywikipedia\upload.py", line 229, in run return self.upload_image File "C:\Documents and Settings\Jim\My Documents\Downloads\Applications\Python WikiBot\pywikipedia\upload.py", line 201, in upload_image returned_html = returned_html.decode(self.targetSite.encoding) File "C:\Python24\lib\encodings\utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xa9 in position 342: unexpected code byte

I get the same error no matter what image file I use. I am running python 2.4 on Windows XP, and my user-config.py setting are:

mylang = 'en' family = 'uwpn' usernames['uwpn']['en'] = 'WikiBot' console_encoding = 'utf-8'

Any advice?

Ioneil 21:58, 20 May 2006 (UTC)

Upload multiple files?
Can I upload multiple files at once with this .py file? Odessaukrain 04:37, 8 January 2007 (UTC)
 * I hacked together Uploadmultiple.py which did the job for me. It's sloppy, but seems to work well enough. -Jonathan Kovaciny 21:57, 8 June 2007 (UTC)

Block Warnings
Is there any way to blog all warnings (like chaching name, file bigger them 150k, overwriting file etc.)?

Problem
I repeatedly get the following error message. I am able to upload images using Commons:Special:Upload. I am able to upload text using pagefromfile.py. I would welcome suggestions.

Walter Siegmund (talk) 00:24, 16 May 2010 (UTC)