1function checkSize() { 2 // check for browser support (may need to be modified) 3 if (!this.files) return; 4 if (!this.files.length == 1) return; 5 6 var size = this.files[0].fileSize || this.files[0].size; 7 var ext = "B"; 8 if (size > 1024) { ext = "KB"; size = size / 1024; } 9 if (size > 1024) { ext = "MB"; size = size / 1024; } 10 if (size > 1024) { ext = "GB"; size = size / 1024; } 11 12 this.title = "File size detected as " + size.toFixed(1) + " " + ext + "."; 13 14 if (ext == "GB" || (ext == "MB" && size > 6)) { // Max 6 MB 15 alert("File uploads are limited to 6 MB, your file is " + size.toFixed(1) + " " + ext + "."); 16 this.value=""; 17 } 18} 19 20window.addEventListener('load', function() { 21 var inp = document.getElementById('upload'); 22 inp.addEventListener('change', checkSize); 23});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.