Skip to content

Upload component sets status: "error" for cloud-only files #55694

@mleister97

Description

@mleister97

Reproduction link

https://ant.design/components/upload

Steps to reproduce

When using the Ant Design Upload or Dragger component, files that exist only in cloud storage (OneDrive, iCloud, Google Drive) automatically get status: "error" and cannot be uploaded.

  1. Use Ant Design Upload or Dragger component.
  2. Select a file that exists only in cloud storage (e.g., OneDrive, iCloud, Google Drive).
    On Android devices, this can happen when selecting a file directly from the cloud picker.

What is expected?

The file should be uploaded normally or a proper error notification should be shown.

The file should not get stuck in status: "error" automatically.

What is actually happening?

  • The file immediately gets status: "error".
  • The upload does not proceed, and onChange shows the file as failed.
Environment Info
antd 5.28.1
React 18.3.1
System Windows 11
Browser Latest Chrome

Proposed solution:
To handle cloud-only files, read the file fully into memory and create a new File object before uploading:

const buffer = await file.arrayBuffer();
const clone = new File([buffer], file.name, { type: file.type });
return clone; // upload this clone instead

This ensures that cloud-only files are treated as real File objects and prevents the automatic status: "error" state.

Metadata

Metadata

Labels

help wantedThe suggestion or request has been accepted, we need you to help us by sending a pull request.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions