Is there any way to delete files from folder using javascript..? Here is my function
function deleteImage(file_name)
{
var r = confirm(\"Are you
You cannot delete anything without any server-side script..
You can actually use ajax and call a server-side file to do that for e.g.
Make a file delete.php
and in the javascript
function deleteImage(file_name)
{
var r = confirm("Are you sure you want to delete this Image?")
if(r == true)
{
$.ajax({
url: 'delete.php',
data: {'file' : "" + file_name },
success: function (response) {
// do something
},
error: function () {
// do something
}
});
}
}