# 在创建条目时不再支持上传文件

> Source: https://strapi.nodejs.cn/cms/migration/v4-to-v5/breaking-changes/no-upload-at-entry-creation

🌐 Upload a file at entry creation is no longer supported

在 Strapi 5 中，创建条目时上传文件不再受支持。用户必须先通过上传 API 上传文件，然后使用文件 ID 创建条目。

🌐 In Strapi 5, uploading a file while creating an entry is no longer supported. Users must upload the file first via the Upload API, then create the entry with the file id.

在 Strapi 5 中，创建条目时无法上传文件，因此应分两步完成。

🌐 In Strapi 5, it is not possible to upload a file while creating an entry, so this should be done in 2 steps.

此页面是[重大更改数据库](/cms/migration/v4-to-v5/breaking-changes)的一部分，提供关于重大更改的信息以及从 Strapi v4 迁移到 Strapi 5 的附加说明。

🌐 This page is part of the [breaking changes database](/cms/migration/v4-to-v5/breaking-changes) and provides information about the breaking change and additional instructions to migrate from Strapi v4 to Strapi 5.

- Is this breaking change affecting plugins? Yes
- Is this breaking change automatically handled by a codemod? No

## 重大变更描述 {#breaking-change-description}

🌐 Breaking change description

**在 Strapi v4 中**

在创建条目时可以上传文件，如 [documented for Strapi v4](https://docs-v4.strapi.io/cms/plugins/upload#upload-files-at-entry-creation)所示。

**在 Strapi 5 中**

你必须先上传文件，然后使用创建的文件 ID 创建条目。

🌐 You must upload the file first, and then create the entry with the created file id.

## 迁移 {#migration}

🌐 Migration

本节重新组合了有关引入的重大更改的有用说明和程序。

🌐 This section regroups useful notes and procedures about the introduced breaking change.

### 迁移程序 {#migration-procedure}

🌐 Migration procedure

用户必须更新他们的自定义代码，首先向 [`/api/upload/`的 Upload API](/cms/api/rest/upload) 发送 [POST 调用](/cms/api/rest/upload)，然后使用创建的文件 ID 向 [`/api`的 REST API](/cms/api/rest#create) 发送 [POST 调用](/cms/api/rest#create) 创建一个条目。

🌐 Users must update their custom code, first sending a [POST call to the Upload API at `/api/upload/`](/cms/api/rest/upload), then creating an entry with a [POST call to the REST API at `/api`](/cms/api/rest#create) with the created file id.
