Commons:Maximum file size/zh

维基共享资源中,文件的最大文件大小5 GiB (5,368,709,120 字节[1])。 使用上传向导、支持分段上傳的其他工具、和服务器上传必须小于这一限制。[2][3] 其他情况下限制为 100 MiB (104,857,600 字节)[4] ,由于上传的一些技术问题。[5][6]

这意味着在不分割文件分别上传的情况下,不可能上传超过最大文件大小的文件。模板{{Split file}}可以用于链接因为这个原因被分割的各個文件。

Please note that every effort should be made to keep files under the file size limit without splitting them. There are various means to do this, including changing file formats, removing parts of a file not really needed, and downsampling resolution, increasing compression levels, etc. Only where these measures aren't enough (because further loss of detail would reduce quality too much) should files be split.

In particular, TIFF images are often very large, but can have their file size reduced by enabling compression. As long as the compression method is lossless (such as “deflate” or “LZW”), the file size reduction does not affect image quality (but beware of obscure compression methods which can cause data loss, or make the file incompatible with some software).

此外,单一账户的上传大小没有限制。不过,如果你计划数以TB计的批量上传,建议提醒系统管理员

注意:大的SVG文件(> 5 MiB)需要在接近文件开始的地方出现翻译

最大上传的大小

虽然支持「托管」最大到5 GiB的文件,但是「上传」的最大文件大小是100MB。上传向导和其他的社群维护工具可以通过分段上传以更小(<100MB)的部份上传这些文件,并由服务器合并。

In general you should be able to upload files close to the 5 GiB limit using chunked uploads without any issues. In the past bugs broke most large uploads, but as of October 29, 2021, these have been fixed now.[7]. Large uploads using the upload-by-url functionality may still timeout (especially those from archive.org[8]). In these cases you are recommended to download the file locally and then re-upload it using chunked uploads.

If you are still unable to upload the file (receiving 503/504 or "stash failed" type errors), request a server-side upload.

縮圖的最大尺寸

Since December 17, 2021 the servers have no size limit for generating thumbnails. Instead, a timeout of 59 seconds for generating thumbnails was configured by using the new Thumbor service.[9]

However, for large GIF animations the limit is currently 100 megapixels. For files where the software does not provide thumbnails because of this limitation, a thumbnail version (either a full-sized JPEG or a smaller PNG) should be uploaded for thumbnail/preview purposes, and linked with the main file. The templates {{Archival version}} and {{Compressed version}} are available for this.

An unrelated reason thumbnails may fail to display (example) is for very long filenames – so long that they approach the 255-byte limit of filename length (which for some cases with non-ASCII characters may be much less than 255 characters, due to UTF-8). It is impossible to upload a file that has a name this large, but it is possible to move a file to such a name.[10]

參考資料

  1. gerrit:280831, gerrit:1002813
  2. 原先是500 MiB,增大为1,000 MiB在2013年11月,增大为2,047 MiB在2016年2月,增大为4 GiB在2016年4月,增大为5 GiB在2024年2月
  3. 4 GiB是硬性限制,因為MediaWiki以32位元整數的形式儲存檔案大小。這是32位元整數所能表示的最大位元組數(phab:T191805)。5 GiB 的限制來自 OpenStack Swift 軟體所支援的容器大小(phab:T191802)。
  4. 剛開始的大小限制在20 MB,2008年11月則提升至100 MB。
  5. 互助客棧(2011-11年)
  6. Wikitech-l: Upload file size limit (2010-07)
  7. wikitech:Incident documentation/2021-11-04 large file upload timeouts
  8. T295009: Improve download speed from archive.org on appservers
  9. 配置更改, Phab:T291014#7367570: 59秒超時
  10. phab:T32202

說明

Category:Commons files/zh
Category:Commons files/zh