Below is a part of my program.
function displayFile(file) {
document.getElementById("name").textContent = file.fileName;
document.getElementById("size").textContent = file.fileSize;
var reader = new FileReader();
reader.onload = function(event) {
document.getElementById('file-content').innerHTML = "Succeed!";
};
reader.onerror = function(e) {
document.getElementById('file-content').innerHTML = "Unable to read " + file.fileName;
开发者_开发知识库 };
reader.readAsDataURL(file);
}
why it always occurs an error?...
精彩评论