How can I customize the fetch method to work with the FilePond file uploader?
P粉129275658
P粉129275658 2023-09-01 21:32:47
0
1
672
<p>I encountered a problem when using FilePond's custom <code>fetch</code> method and I didn't know what to do with the <code>load()</code> function. The documentation requires passing the file object to the <code>load()</code> method, but I don't know how to get it. I tried passing <code>null</code> but it throws an error: This is the code: </p> <pre class="brush:php;toolbar:false;">server: { fetch: (url, load, error, progress, abort, headers) => { progress(true, 0, 1024); load(file); return { abort: () => { abort(); }, }; },</pre> <p>Any ideas? </p>
P粉129275658
P粉129275658

reply all(1)
P粉340980243

This is what I do when getting files from the server in my 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);
              });
            });
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template