pqina / filepond

🌊 A flexible and fun JavaScript file upload library
https://pqina.nl/filepond
MIT License
15.16k stars 825 forks source link

Revert or remove file on REST API with dynamic url #595

Closed beejaz closed 3 years ago

beejaz commented 3 years ago

Very nice to explore FilePond, kudos!

I have a struggle with revert / remove file after it has been uploaded. I run a PHP backend with OpenAPI 3 REST API standard and I need/want to use a dynamic url when revert/delete. I use Vue-adapter.

I use this method to return the uuid after file has been uploade to my example.com/media

process: {
  onload: response => {
    return JSON.parse(response)['@id']
},

If i use the revert: '/' way to remove, it will send the id as body to /media/, but I need to send it do DELETE /media/uniqueFileId route. I tried some ways with revert and remove but didnt manage to get it to be dynamic. If i use revert as a function, am i supposed to use axios or fetch to make a custom request to my endpoint or is there some other way im missing?

revert: (uniqueFileId, load, error) => {
  console.log(uniqueFileId)
  error('problems')
  load()
}
rikschennink commented 3 years ago

Thanks!

We require the issue template to be filled out on all new issues. The issue template helps us collect all the information we need to address your submission efficiently.

If your issue can be classified as an integration question or a question about specific features of FilePond we ask you kindly to submit it on Stack Overflow.

We will be able to more closely look at your issue once the issue template has been filled out. This issue will be closed in 5 days if the template is not filled out or if the issue is determined to be a question.

beejaz commented 3 years ago

Hi, sorry, ill post my question on Stack Overflow instead http://plz.wtf/iNDLg