I have found these code snippets http://www.html5rocks.com/en/tutorials/file/dndfiles/#toc-selecting-files-input and I want to see how they work but the code doesn't work in my case. Maybe I do something wrong with its integration? Please share some integration snippets because I am really new in JS :)
here is my maybe wrong integration...
<html>
<head>
<script language="javascript" type="text/javascript">
// Check for the various File API support.
if (window.File && window.FileReader && window.FileList && window.Blob) {
// Great success! All the File APIs are supported.
} else {
alert('The File APIs are not fully supported in this browser.');
}
function handleFileSelect(evt) {
var files = evt.target.files; // FileList object
// files is a FileList of File objects. List some properties.
var output = [];
for (var i = 0, f; f = files[i]; i++) {
output.push('<li><strong>', f.name, '</strong> (', f.type || 'n/a', ') - ',
f.size, ' bytes, last modified: ',
f.lastModifiedDate.toLocaleDateString(), '</li>');
}
document.getElementById('list').innerHTML = '<ul>' + output.join('') + '</ul>';
}
document.getElementById('files').addEventListener('change', handleFileSelect, false);
</script>
</head>
<body>
<div>
<input type="file" id="files" name="files[]" multiple />
<output id="list"></output>
</div>
<body>
</html>
P.S> My Internet Browser: FF 5.0
All useful comments are appreciated :)