I am trying to build a custom drag drop and file upload. My div container is empty. Upon drop file i am '' an '' type file into the container and want to trigger its file attachment functionality. my code is not working properly . kindly advice or guide. your favour will be appreciated.
following is my code
<div class="drag" ondrop="drop(event)" ondragover="allowDrop(event)">
function allowDrop(event) {
event.preventDefault();
}
function addinputfile(){
$('.drag').append('<div class="upload"><input type="file" name="ufile[]" id="ufile" multiple></div>');
}
function drop(event) {
event.preventDefault();
console.log('something dropped here!');
addinputfile();
$('#input#ufile').trigger("click");
}
code is simply adding '' file type and hitting it to use for file upload.