Skip to content
Snippets Groups Projects

WIP: Upload issues

Merged Carsten Fortmann-Grote requested to merge upload_issues into master
Compare and Show latest version
2 files
+ 33
1
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 26
1
@@ -17,4 +17,29 @@
{{ dropzone.load_js() }}
{{ dropzone.config(redirect_url=url_for('submit'), custom_options='addRemoveLinks: true') }}
</p>
{% endblock %}
\ No newline at end of file
<script type="text/javascript">
$(document).ready(function () {
alert("success 1");
console.log("3");
Dropzone.options.myAwesomeDropzone = {
success: function(file, response) {
console.log("5");
file.serverFileName = response.file_name; // pass filename
},
removedfile: function (file, data) { // triggered when remove file button was clicked
$.ajax({ // send AJAX request to Flask to remove file
type:'POST',
url:'/deletefile',
data : {"filename" : file.serverFileName}, // pass filename
success : function (data) {
alert('File removed from server.')
}
});
}
};
});
</script>
{% endblock %}
Loading