webdav-client icon indicating copy to clipboard operation
webdav-client copied to clipboard

Is it possible to delete a directory using client.deleteFile?

Open ArteilDev opened this issue 10 months ago • 1 comments

A question arose, is it possible to delete a directory (folder) using client.deleteFile? When trying to do this, an error occurs Access to fetch at 'http://.....' from origin 'http://localhost:5173' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request. But the files are successfully deleted, without an error CORS

ArteilDev avatar Feb 28 '25 14:02 ArteilDev

It should work as such, and the fact that the directory was removed reaffirms that. There’s a node test here: https://github.com/perry-mitchell/webdav-client/blob/master/test/node/operations/deleteFile.spec.ts#L53 - but it would be good to have one for the web tests too, considering your CORS error. It may also just be server misconfiguration too.

perry-mitchell avatar Feb 28 '25 15:02 perry-mitchell