File
object
To enable users to manipulate local files directly through HTML5's file API, doM's File interface provides abstractions of local files. Electron adds a path property to the File interface, which is the true path of the file in the system.
Get an example of the real Chinese dragged to the APP:
<div id="holder">
Drag your file here
</div>
<script>
var holder = document.getElementById('holder');
holder.ondragover = function () {
return false;
};
holder.ondragleave = holder.ondragend = function () {
return false;
};
holder.ondrop = function (e) {
e.preventDefault();
var file = e.dataTransfer.files[0];
console.log('File you dragged here is', file.path);
return false;
};
</script>