手册:$wgEnableUploads

This page is a translated version of the page Manual:$wgEnableUploads and the translation is 43% complete.
Other languages:
English • ‎français • ‎magyar • ‎polski • ‎português • ‎português do Brasil • ‎中文 • ‎日本語
上传: $wgEnableUploads
允许通过wiki上传图片和其他文件。
引进版本:1.5.0
移除版本:仍在使用
允许的值:(布尔值)
默认值:false

详情

本命令在 LocalSettings.php 文件中找到,当值设置为true时,用户允许上传图片以及其他被启用的文件。 用户会在工具栏左下角看见一个链接至 上传 页面“上传文件”的链接(通常情况下)。 这个链接会为拥有'上传'权限 的用户(默认是登录了的用户)。

  • Destination filename field there in Special:Upload page is a case sensitive field and should be used to give descriptive filename instead of using the default one populated from source file name.
  • If a file already exists in the system with name Destination filename, uploading this file without changing Destination filename will create a archive file and store the older version in /images/archive folder.
When enabling file uploads, you must also make the images directory writable by the web server, otherwise you will just see an error such as failed to open stream: Operation not permitted or Could not create directory "mwstore://local-backend/local-public/0/00". Note that a web server writable directory is not insecure in itself, but can be thought of as the first half of a successful attack to your web server, as such you might like to explore alternatives using img_auth.php.

IMPORTANT: Uploads need to be set up properly in order to be secure! There are several related configuration settings. It is recommended to read the more complete instructions at 手册:配置文件上传

参见