diff --git a/convertFileSize.js b/convertFileSize.js index 4d3b4dd..22bef4b 100644 --- a/convertFileSize.js +++ b/convertFileSize.js @@ -1,14 +1,13 @@ -function convertFileSize(fileSizeInBytes) -{ +function convertFileSize(fileSizeInBytes){ var i = -1; var byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB']; - do { + do{ fileSizeInBytes = fileSizeInBytes / 1024; i++; - } while (fileSizeInBytes > 1024); + }while(fileSizeInBytes > 1024); return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i]; } diff --git a/getFileInfo.js b/getFileInfo.js index f653b1c..47fdc7b 100644 --- a/getFileInfo.js +++ b/getFileInfo.js @@ -1,11 +1,10 @@ -$(function() -{ - if (window.File) - { - $('#upload').bind('change', function() - { +$(function(){ + if (window.File){ + $('#upload').bind('change', function(){ var fileinfo = 'size: ' + this.files[0].size + '
' + 'name: ' + this.files[0].name + '
' + 'extension: ' + file_extension(this.files[0].name); $('#fileinfo').html(fileinfo); }); + } +} \ No newline at end of file