MediaWiki Upload File
AI-generatedSummary
Uploads a binary file from each input item to a MediaWiki site via api.php, logging in with the bot credentials and setting the file description page text and upload comment.
Inputs
- Wiki URL — Overrides the site URL from the mediaWikiApi credentials. A trailing slash is removed and /api.php is appended.
- Input Binary Field (required) — Name of the binary property on the input item that holds the file to upload (default "data").
- Filename (required) — Target file name on the wiki, e.g. "Example.png".
- Description — Wikitext for the file description page (sent as the upload's text field).
- Upload Comment — Comment shown in the upload log. Defaults to "File uploaded via n8n".
- Ignore Warnings — When on, sends ignorewarnings=1 so warnings such as an existing file or a duplicate don't block the upload. Off by default.
Output shape
One output item per input item. On success the JSON has success: true, filename, result (the MediaWiki API's upload object), filesize and mimeType from the input binary.
For each item the node logs in, fetches a CSRF token, then uploads. This takes several requests per item. If the API returns an error, or returns warnings while Ignore Warnings is off, the node throws. With Continue On Fail enabled it instead emits {success: false, error: message} for that item. Requires mediaWikiApi credentials (siteUrl, botUsername, botPassword).
Examples
Example 1: Upload an image downloaded by an earlier HTTP Request node to the wiki.
Input Binary Field=data, Filename=Logo.png, Description="== Summary ==\nCompany logo", Ignore Warnings off.
Example 2: Overwrite an existing file on a different wiki using the same bot credentials.
Wiki URL=https://wiki2.example.com, Filename=Report.pdf, Upload Comment="Updated report", Ignore Warnings on.