Created
April 12, 2018 00:29
-
-
Save obonyojimmy/4c8da6535d32944f9be44aa7b6ad3f43 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/giyohiw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="output" style="min-height: 200px; white-space: pre; border: 1px solid black;" | |
ondragenter="document.getElementById('output').textContent = ''; event.stopPropagation(); event.preventDefault();" | |
ondragover="event.stopPropagation(); event.preventDefault();" | |
ondrop="event.stopPropagation(); event.preventDefault(); | |
dodrop(event);"> | |
DROP FILES HERE FROM FINDER OR EXPLORER | |
</div> | |
<script id="jsbin-javascript"> | |
function dodrop(event) | |
{ | |
var dt = event.dataTransfer; | |
var files = dt.files; | |
var count = files.length; | |
output("File Count: " + count + "\n"); | |
for (var i = 0; i < files.length; i++) { | |
output(" File " + i + ":\n(" + (typeof files[i]) + ") : <" + files[i] + " > " + | |
files[i].name + " " + files[i].size + "\n"); | |
} | |
} | |
function output(text) | |
{ | |
document.getElementById("output").textContent += text; | |
//dump(text); | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">function dodrop(event) | |
{ | |
var dt = event.dataTransfer; | |
var files = dt.files; | |
var count = files.length; | |
output("File Count: " + count + "\n"); | |
for (var i = 0; i < files.length; i++) { | |
output(" File " + i + ":\n(" + (typeof files[i]) + ") : <" + files[i] + " > " + | |
files[i].name + " " + files[i].size + "\n"); | |
} | |
} | |
function output(text) | |
{ | |
document.getElementById("output").textContent += text; | |
//dump(text); | |
} | |
</script></body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dodrop(event) | |
{ | |
var dt = event.dataTransfer; | |
var files = dt.files; | |
var count = files.length; | |
output("File Count: " + count + "\n"); | |
for (var i = 0; i < files.length; i++) { | |
output(" File " + i + ":\n(" + (typeof files[i]) + ") : <" + files[i] + " > " + | |
files[i].name + " " + files[i].size + "\n"); | |
} | |
} | |
function output(text) | |
{ | |
document.getElementById("output").textContent += text; | |
//dump(text); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment