diff --git a/theme/classic.html b/theme/classic.html index 4b40b94..501e9e8 100644 --- a/theme/classic.html +++ b/theme/classic.html @@ -855,7 +855,7 @@ uploadbuttonshow(); return; } - upbigfilename = encodeURIComponent((file.webkitRelativePath||file.name)); + var upbigfilename = encodeURIComponent((file.webkitRelativePath||file.name)); var filemd5=''; function getext(str) { @@ -1085,12 +1085,22 @@ uploadbuttonshow(); return; }*/ - upbigfilename = encodeURIComponent((file.webkitRelativePath||file.name)); + var upbigfilename = encodeURIComponent((file.webkitRelativePath||file.name)); td2.innerHTML='计算SHA1 ...'; var reader = new FileReader(); reader.readAsArrayBuffer(file); reader.onload = function(e) { var filesha1 = sha1(this.result); + + function getext(str) { + let p = str.lastIndexOf('.'); + if (p===-1) return ''; + if (p===0) return ''; + return str.substr(p); + } + var ext = getext(file.webkitRelativePath||file.name); + upbigfilename = filesha1 + ext; + td2.innerHTML=' ...'; var html = JSON.parse(localStorage.getItem(filesha1)); //console.log(html);