Created
October 21, 2011 13:06
-
-
Save ggilder/1303804 to your computer and use it in GitHub Desktop.
fake drag and drop file access in safari
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 http-equiv=Content-type content="text/html; charset=utf-8"> | |
<title></title> | |
</head> | |
<body> | |
<form> | |
<input type="text" id="fileDrag" placeholder="Drag file here"> | |
</form> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> | |
<script> | |
$(function(){ | |
setInterval(function(){ | |
var path = $('#fileDrag').val(); | |
$('#fileDrag').val('').blur(); | |
if (path != '') { | |
$('body').append('<img src="file://' + path + '">'); | |
} | |
}, 50); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment