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
3 files
+ 19
29
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 9
26
@@ -15,31 +15,14 @@
<p>
{{ dropzone.create(action=url_for('upload')) }}
{{ dropzone.load_js() }}
{{ dropzone.config(custom_options='addRemoveLinks: true, dictRemoveFileConfirmation: null') }}
{{ dropzone.config()}}
</p>
<p>
{% if confirmation_form is not None %}
<form action="{{ url_for('submit') }}" method="post" enctype="multipart/form-data">
{{ confirmation_form.hidden_tag() }}
{{ confirmation_form.go(title="Confirm file uploads") }}
</form>
{% endif %}
</p>
<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