Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Laravel: remove file with Dropzone
removedfile: function(file) {
var name = file.name;
var token = $('[name=_token').val();
var dir = $('[name=dir]').val();
console.log(file.name);
$.ajax({
type: 'POST',
headers: {'X-CSRF-Token': token},
url: '/delete-gallery-image',
data: {id: name, dir: dir },
dataType: 'html'
});
var _ref;
return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
availableImages = availableImages + 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.