0

I tried this but keep getting following error when I put this into a content editor web part.

<script type="text/javascript">
var FSO = new ActiveXObject("Scripting.FileSystemObject");
var input_File = document.aspnetForm.ctl00_PlaceHolderMain_ctl01_ctl02_InputFile.value;
var uploaded_file = FSO.getFile(input_File);
var file_size = uploaded_file.size;        //size in bytes
alert(file_size + " bytes");
</script>

Message: Automation server can't create object

Chunkey pandey
  • 183
  • 1
  • 1
  • 7

1 Answers1

0

I've never tried this before, but this seems like a relatively similar situation: Find size of file behind download link with jQuery

Maybe you can convert that syntax over to your application's needs and get it working for you. Best of luck!

Community
  • 1
  • 1
AlienWebguy
  • 76,997
  • 17
  • 122
  • 145
  • @AWG: Actually, this link is good but I need to determine the file size before user can upload the file. http://jshidell.wordpress.com/2010/09/20/show-document-file-size-using-jquery/ – Chunkey pandey Jul 08 '11 at 21:54