You cannot upload it locally aka http://localhost/upload
, since there is not server waiting for an upload at this endpoint. You need a service for this one and cannot just upload a file like this (to my knowledge). And even if it somehow works, you could not have it working on production since people will not have a localhost when visiting your website.
Looking on the Vue framework documentation page, you need to pass a server
prop. Then, you can pretty much configure it to your need or post it yourself when you have the files themselves thanks to this.$refs.pond.getFiles()
.
The API Server documentation is giving some example of configuration:
FilePond.setOptions({
server: {
url: 'http://192.168.0.100',
timeout: 7000,
process: {
url: './process',
method: 'POST',
headers: {
'x-customheader': 'Hello World'
},
withCredentials: false,
onload: (response) => response.key,
onerror: (response) => response.data,
ondata: (formData) => {
formData.append('Hello', 'World');
return formData;
}
},
revert: './revert',
restore: './restore/',
load: './load/',
fetch: './fetch/'
}
})
It's not directly Vue but you can pretty much map it one to one in the same way by using the server
prop.
Sorry if I cannot help more but it all depends on how you plan to do it and where you plan to upload it (if it's AWS S3 or something else).
You can check this configuration to get some inspiration for your server
prop.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…