我试图将上传的文件显示给文件集并下载。
我可以将它添加到filepond字段中,但它可以算作需要上传的另一个文件。
这里是我的FilePond代码
FilePond.setOptions({
allowMultiple: true,
instantUpload: false,
server: {
url: BASE_URL,
timeout: 7000,
},
});添加数据
var files = data.attachments_path;
var filesLengths = files.length;
for (var j = 0; j < filesLengths; j++) {
console.log(files[j]);
ponds.addFiles(files[j]);
}有什么可以做的吗?
发布于 2022-05-30 05:50:49
您需要将初始文件列表设置为files属性上的数组。
const pond = FilePond.create({
files: [
{
// The id of the file
source: '12345',
// A 'local' file has been uploaded
// to the server in a previous sessions
options: {
type: 'local',
},
},
],
});请参阅:https://pqina.nl/filepond/docs/api/instance/properties/#files
https://stackoverflow.com/questions/72404768
复制相似问题