/
sample.html
30 lines (26 loc) · 888 Bytes
/
sample.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html>
<head>
<title>readfileby - sample</title>
<style>
#droparea { width: 200px; height: 90px; border: 1px dashed black;}
</style>
</head>
<body>
<h1 id="logo">readfileby - sample</h1>
<h3>note: must be run from a server, not a local file (will not work
if run from a local file)</h3>
<div id="droparea">drop files here</div>
<input type="file" id="files" name="files">
<br><hr><br>
<script src="./main.js"></script>
<script>
ReadFileBy.Paste.asDataURL(document.body, function(duri){var i = new Image();
i.src=duri; document.body.appendChild(i);});
ReadFileBy.Drop.asDataURL(document.getElementById('droparea'), function(duri){var i = new Image();
i.src=duri; document.body.appendChild(i);});
ReadFileBy.FileSelect.asDataURL(document.getElementById('files'), function(duri){var i = new Image();
i.src=duri; document.body.appendChild(i);});
</script>
</body>
</html>