If it's not a local application powered by JavaScript with full access permissions, you can't get the size of any file just from the path name. Web pages running javascript do not have access to the local filesystem for security reasons.
You can use a graceful degrading file uploader like SWFUpload if you want to show a progress bar. HTML5 also has the File API, but that is not widely supported just yet. If a user selects the file for an input[type=file]
element, you can get details about the file from the files
collection:
alert(myInp.files[0].size);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…