MediaWiki API 帮助

这是自动生成的MediaWiki API文档页面。

文档和例子:https://www.mediawiki.org/wiki/API:Main_page/zh

action=upload

main | upload
  • 此模块需要读取权限。
  • 此模块需要写入权限。
  • 此模块只允许POST请求。

Upload a file, or get the status of pending uploads.

Several methods are available:

  • Upload file contents directly, using the file parameter.
  • Upload the file in pieces, using the filesize, chunk, and offset parameters.* Have the MediaWiki server fetch a file from a URL, using the url parameter.
  • Complete an earlier upload that failed due to warnings, using the filekey parameter.

Note that the HTTP POST must be done as a file upload (i.e. using multipart/form-data) when sending the file.

参数:
filename

目标文件名。

comment

上传注释。如果没有指定text,那么它也被用于新文件的初始页面文本。

默认:(空)
text

Initial page text for new files.

watch
不推荐使用。

监视页面。

watchlist

无条件地将页面加入至当前用户的监视列表或将其移除,使用设置或不更改监视。

一个值:watch、preferences、nochange
默认:preferences
ignorewarnings

忽略任何警告。

file

文件内容。

Must be posted as a file upload using multipart/form-data.
url

URL to fetch the file from.

filekey

Key that identifies a previous upload that was stashed temporarily.

sessionkey
不推荐使用。

Same as filekey, maintained for backward compatibility.

stash

如果设置,服务器将临时藏匿文件而不是加入存储库。

filesize

Filesize of entire upload.

offset

块的偏移量(字节)。

chunk

大块内容。

Must be posted as a file upload using multipart/form-data.
async

Make potentially large file operations asynchronous when possible.

asyncdownload

Make fetching a URL asynchronous.

leavemessage

If asyncdownload is used, leave a message on the user talk page if finished.

statuskey

Fetch the upload status for this file key (upload by URL).

checkstatus

Only fetch the upload status for the given file key.

token

action=query&meta=tokens取回的“csrf”令牌

这个参数是必须的。