# Strapi 云的上传大小限制

> Source: https://strapi.nodejs.cn/cloud/advanced/upload-size-limits

🌐 Upload size limits for Strapi Cloud

所有方案中，非图片文件的大小上限为 200 MB。图片文件的推荐最大值基于内存，并根据格式、方案以及媒体库设置而有所不同。要上传更大的图片，请禁用响应式友好上传和尺寸优化。

Strapi Cloud 对上传应用两种不同的限制。第一种是硬性最大文件大小限制，在基础设施层面对非图片文件强制执行。第二种是基于内存的对图片文件的推荐限制，取决于你的 CMS 设置。

🌐 Strapi Cloud applies 2 distinct limits to uploads. The first is a hard maximum file size, enforced at the infrastructure level for non-image files. The second is a memory-based recommendation for image files that depends on your CMS settings.

## 非图片文件的最大上传文件大小 {#maximum-upload-file-size-for-non-image-files}

🌐 Maximum upload file size for non-image files

在所有 Strapi Cloud 计划中，非图片上传的大小上限为 200 MB。该上限在基础设施层面执行，无法通过 `strapi::body` 中间件配置覆盖。

🌐 Non-image uploads are capped at 200 MB on all Strapi Cloud plans. The cap is enforced at the infrastructure level and cannot be overridden via the `strapi::body` middleware configuration.

## 图片文件的建议最大上传大小 {#recommended-maximum-upload-size-for-image-files}

🌐 Recommended maximum upload size for image files

图片上传受额外的、基于内存的推荐限制，该限制独立于非图片上限，并且因图片格式而异。

🌐 Image uploads are subject to an additional, memory-driven recommendation that is independent of the non-image cap and varies by image format.

:::tip Uploading a large image?

要上传大于建议最大值的图片，请在[媒体库设置](/cms/features/media-library#configuring-settings)中同时禁用响应式友好上传和大小优化。这样，CMS 将按原样存储源文件，而不进行处理，从而提高建议的最大值（请参见下表中的 _处理关闭_ 值）。

🌐 To upload an image larger than the recommended maximum, disable both Responsive friendly upload and Size optimization in the [Media Library settings](/cms/features/media-library#configuring-settings). The CMS then stores the source file as-is without in-process processing, which raises the recommended maximum (see the _Processing off_ values in the tables below).

:::

当在[媒体库设置](/cms/features/media-library#configuring-settings)中同时启用响应式友好上传和大小优化时，CMS 会调整源图片的大小，并在保存之前在实例的内存中生成一组缩略图（小、中、大）。此处理在进程内进行，无论配置的上传提供者如何。

🌐 When Responsive friendly upload and Size optimization are both enabled in the [Media Library settings](/cms/features/media-library#configuring-settings), the CMS resizes the source image and generates a set of thumbnails (small, medium, large) in the instance's memory before persisting them. This processing happens in-process, regardless of the configured upload provider.

切换到第三方提供商（Amazon S3、Cloudinary 等）并不是一个解决方法。调整大小和生成缩略图的步骤仍然在 Strapi Cloud 实例内部运行，并且仍然需要与源图片尺寸成比例的内存。

🌐 Switching to a third-party provider (Amazon S3, Cloudinary, etc.) is not a workaround. The resize and thumbnail generation step still runs inside the Strapi Cloud instance and still requires memory proportional to the source image dimensions.

实际内存使用情况取决于图片的尺寸、格式以及你的媒体库设置。以下表格中的数值仅为推荐值，而非硬性限制。超过推荐大小的上传很可能导致实例内存不足并重启。

🌐 Actual memory usage depends on the image dimensions, format, and your Media Library settings. The values in the following tables are a recommendation, not a hard limit. Uploads above the recommended size are likely to cause the instance to run out of memory and restart.

该建议取决于[媒体库设置](/cms/features/media-library#configuring-settings)中是否启用了响应式友好上传和尺寸优化：

🌐 The recommendation depends on whether Responsive friendly upload and Size optimization are enabled in the [Media Library settings](/cms/features/media-library#configuring-settings):

- _处理于_：两个设置均已启用，使用默认的 `small`、`medium` 和 `large` 尺寸。Strapi 在内存中生成缩略图，因此安全上传大小较小。
- _处理关闭_：两个设置均已禁用。源图片将按原样存储，不进行处理，因此安全上传大小更高。

每种格式和计划的推荐最大图片尺寸，以兆像素（MP）表示：

🌐 Recommended maximum image size, expressed in megapixels (MP), per format and plan:

| 格式 | 初级 | 专业与商业 |
|--------|------------------|-------------|
| JPEG | 26 MP | 135 MP |
| PNG | 10 MP | 90 MP |
| WebP | 4 MP | 12 MP |
| TIFF | 24 MP | 125 MP |
| AVIF | 92 MP | 92 MP |
| 格式 | 初级 | 专业与商业 |
|--------|------------------|-------------|
| JPEG | 224 兆像素 | 265 兆像素 |
| PNG | 24 兆像素 | 115 兆像素 |
| WebP | 15 兆像素 | 40 兆像素 |
| TIFF | 24 兆像素 | 125 兆像素 |
| AVIF | 96 兆像素 | 96 兆像素 |

:::note Converting pixels to megapixels

图片的百万像素数是其宽度乘以高度的像素数，然后除以1,000,000。与给定百万像素数匹配的像素尺寸取决于纵横比。对于正方形图片，1百万像素大约是1000×1000像素，4百万像素大约是2000×2000像素，而100百万像素大约是10000×10000像素。

🌐 The number of megapixels of an image is its width multiplied by its height in pixels, divided by 1,000,000. The pixel dimensions that match a given megapixel count depend on the aspect ratio. For a square image, 1 MP is roughly 1000×1000 px, 4 MP is roughly 2000×2000 px, and 100 MP is roughly 10000×10000 px.

:::

:::strapi Configuring a provider

要配置诸如 Amazon S3 或 Cloudinary 之类的外部存储，请参阅 [Strapi Cloud 的上传提供程序配置](/cloud/advanced/upload)。

🌐 To configure external storage such as Amazon S3 or Cloudinary, see [Upload Provider Configuration for Strapi Cloud](/cloud/advanced/upload).

:::
