我有一个从url地址设置默认文件的问题。
我的Filepond
<FilePond
files={[{
source:"https://firebasestorage.googleapis.com/v0/b/tradeon-main.appspot.com/o/product_photos%2F5ba67faefe791907942c2d96%2Fc3e6c0bf-ec5f-25db-09ec-cfbe982498cd?alt=media&token=f9afc39b-5a2a-43d7-bf23-66b07919964e",
options: {
type: 'local'
}
}]}/>
我得到了下面的错误“大小不可用”,这是渲染而不是图像。控制台中没有错误。我在版本7.1.1中使用了react-filepond
是bug还是我做了什么坏事?
发布于 2021-06-23 15:44:00
因为type设置为'local‘,所以FilePond将尝试使用server.load终结点加载文件。因为'local'指示文件在本地服务器上,应该将其“恢复”到视图中。
更多信息请点击这里:https://pqina.nl/filepond/docs/api/server/#load
<FilePond
server={{
load: (src, load) => {
// load file here and return file object to load
fetch(src)
.then(res => res.blob())
.then(load);
}
}}
files={[{
source: 'your-local-file-id',
options: {
type: 'local'
}
}]}
/>https://stackoverflow.com/questions/68071812
复制相似问题