Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ivandoric/05afb0e2f40804473907d14a9ee6f50b to your computer and use it in GitHub Desktop.
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