1. 激活附件操作

附件操作可使一个页面带有多个附件.

因为文件上载可能被滥用于 DoS(拒绝服务)攻击, 所以附件操作可以被维基管理员关闭. 详细内容请看Configuration of MoinMoin.

2. 创建附件

要创建新的附件, 你可以在任意页面上增加一个附件链接(后面会说如何操作), 或者点击页面顶部的附件链接. 在第一种情况下, 保存页面后, 你可以看到一个上载新附件的链接. 点击它, 会引导你进入上载页面(就像直接点击附件链接一样).

上载表单包括两部分. 除了输入的文件之外, 还有一个可选域 (改名为), 它用于给上载的文件重新命名.

上载不会覆盖已经存在的文件. 如果有名字冲突, 你必须重新命名待上载的文件. 如果改名为是空白的, 原始文件名将被使用.

已存在的福建可以被察看, 下载或者删除, 这取决于维基的配置以及用户的权限. 例如, 如果用户在某个页面上没有删除权限, 则页面上的附件就不能被删除.

任何上载或者删除附件的操作都会在最新改动上反映出来, 因此是公开的. 与页面改动不同, 它没有历史记载, 所以应该保持文件的本地拷贝, 这样你可以恢复潜在的故意毁坏行为.

3. 附件列表与信息

有两个定义过的宏, 可用于给出某个页面的附件的信息. 宏[[AttachInfo]]对任意附件给出简短的信息:

There are 0 attachment(s) stored for this page.

[[AttachList]]列出页面的附件列表:

4. 附件链接

使用attachment:filename.ext指向页面附件;这种链接可使用一般链接的所有规则, 也就是图片自动嵌入. 不要使用你在附件上载页面看到的[get]链接地址.

你也可以使用 inline: 替代 attachment:, 它会试着嵌入附件的内容. 对于图片(文件扩展名是.gif, .jpg, .jpeg, 或者 .png)这没有区别. Python源代码(也就是附件扩展名为 .py), 会显示为语法高亮的代码. 对其他所有文件, 与attachment:链接效果一样.

第三种链接类型是drawing:, 在下一节介绍.

5. 编辑矢量图形

类似于 Create new drawing "picturename.png" 的链接允许你通过内置的Java程序交互式的编辑矢量图形. 然后Java程序会保存附件"picturename.draw", "picturename.png" 和 "picturename.map". 你第一次保存图形后, 生成的PNG图片会用于显示drawing:链接. MAP文件用于将图片部分激活为链接. 这意味着在任何浏览器中, 你只需要激活Java就可以编辑并显示结果.

第一次保存后, 要再次编辑它, 请点击 附件 并使用 .draw附件的[编辑] 链接. 你也可以点击图片周围不可见的5像素边框来进入编辑状态. 保存图形操作也会在 最新改动上反映出来.

  • /!\ 注意:程序对WikiName不敏感. 你必须提供实际的URLs(相对的或者绝对的)作为链接.

    /!\ 注意:目前图形还不支持非ascii字符作为它们的名字.

关于使用画图程序的细节, 请看 Plugins/TWikiDrawPlugin.

6. 包安装

请看帮助-包安装器.

7. 解压文件

要使用解压功能, 你必须在页面上具有下列权限:

  • read
  • write
  • delete

比如:

#acl UserName:admin,read,write,delete All:read

We implemented some protection for the server against abuse of this feature. Zip files in a Zip file are dropped by unzipping them. By definition of the configuration option unzip_attachments_space, only this total amount of bytes can be used to unzip files. If there are already files in the directory, the amount of them are subtracted from this number. The size of a single file in the archive which will be extracted can be limited using the configuration option unzip_single_file_size. By unzip_attachments_count you could restrict the number of files which are extracted from the zip file.

The rules for unzipping are implemented in the same way as for uploading one file. It is not allowed to overwrite an existing file by unzipping a file.

By unzipping a zip file only files from the first layer are unzipped. Files in directories are ignored.

A valid zip file could be created this way:

zip example.zip *.jpg

7.1. Uploading a zip file

After you have uploaded a zip file, you can see the unzip link.

7.2. No rights to unzip

If you have not enough rights, you only see the usual dialogue.

7.3. Not enough free space free

If the resulting unpacked files exceed the limit of filespace for attachments, you get this warning.

7.4. Successfully unzipped

Upload new attachment "unzip3a.png"
Upload new attachment "unzip3b.png"

7.5. Extracted files would be too large

If a file in the archive exceeds the defined unzip_single_file_size then it is not unzipped.

7.6. zip files in zip file will be ignored

If zip files are included in the zip archive, they will be skipped during the extraction. Regular files included will be extracted.

So the famous 42.zip does not affect the system.

8. To do on this page

  • to review