首页 > 解决方案 > 从 android 文件中的谷歌驱动器(云存储)附加:err_upload_file_changed 错误

问题描述

我有一个 HTML 表单,其中最后有一个 pdf 文件附件字段(),我使用所有字段表单数据发出一个发布请求

何时并选择字段 android 文件选择器打开

PS:如果从谷歌驱动器中选择,我已经设法向用户显示一条消息,请从存储中选择,但我不希望我实际上能够发布带有附件的文件

标签: javascriptandroidhtmlgoogle-chromefile-upload

解决方案


正如评论中所解释的,这是 Chrome 的一个错误(https://bugs.chromium.org/p/chromium/issues/detail?id=1063576)。

还可能引发以下错误:NotReadableError: The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired..

作为一种解决方法,请在进一步使用之前克隆您的文件或 Blob:

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

推荐阅读