我在使用FilePond的自定义fetch方法时遇到了一个问题,不知道该如何处理load()函数。文档要求将文件对象传递给load()方法,但我不知道如何获取它。我尝试传递null,但会抛出错误:这是代码:
server: {
fetch: (url, load, error, progress, abort, headers) => {
progress(true, 0, 1024);
load(file);
return {
abort: () => {
abort();
},
};
},
有什么想法吗?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
这是我在我的FilePond中从服务器获取文件时的做法。
load: async (source, load, error, progress, abort, headers) => { let file = files.find(el => el.file == source) var myRequest = new Request(source); fetch(myRequest).then(function(response) { response.blob().then(function(myBlob) { load(myBlob); }); });