How to delete a file with javascript?

前端 未结 7 1150
栀梦
栀梦 2020-12-18 06:54

Did not have luck with these examples:
Javascript File remove
Javascript FSO DeleteFile Method
Deleting a File

There are no special permissions on the fi

相关标签:
7条回答
  • 2020-12-18 07:53

    If you are doing this in a RESTFUL way, you would send an HTTP DELETE request.

    jQuery's ajax method states that you can use the method parameter to specify 'DELETE' but notes that some browsers may not support it.

    Obviously you will need a webserver which will accept a DELETE request, and apply some sort of authentication/authorization so that joe random visitor can't delete your files. I believe Apache's mod_dav will get you started here.

    0 讨论(0)
提交回复
热议问题