Client side - Implement Uploads

This commit is contained in:
2019-05-27 15:07:36 +05:30
parent 0c428a2b33
commit d8c6001d90
3 changed files with 22 additions and 3 deletions

View File

@@ -125,4 +125,23 @@ $(document).ready(()=>{
})
}
})
$("#fileInput").change((e)=>{
console.log(e.target.files)
$("#fileLabel").html(e.target.files[0].name);
})
$(".done-upload").click(()=>{
$("#upload-directory").val(currDir.loc)
//$("#theForm").ajaxSubmit({url: '/files/upload', type: 'post'})
$.ajax("/files/upload",{
method: 'post',
processData:false,
contentType:false,
data:new FormData(document.getElementById('upload-form')),
success:msg=>{
alert(msg.done)
closeUploadWindow();
},
error:msg=>alert("Error")
})
})
})