I am using file uploading in my web application by using the <input type="file" /> html tag. My feature works well with choosing a file from the file chooser and submitting the file, however now I want to upload a file on drag and drop events i.e. the user drags a file from some location on his computer and when he drops it in a particular section in my web page, the file starts uploading.
Until now I managed to read the files from the drop event by
function drop(evt) { evt.stopPropogation(); evt.preventDefault(); if (containsFiles(evt)) { var files = evt.dataTransfer.files; var count = files.length; // Only call the handler if 1 or more files was dropped. if (count > 0) // upload files } } } but how can I upload these files? I can't change the value of input type = file for security reasons. So what can I do to pass these files to my servlet?