file.FileSize returning -1 in firefox

Last post 05-11-2009, 8:26 AM by cutechat. 1 replies.
Sort Posts: Previous Next
  •  05-11-2009, 6:44 AM 52033

    file.FileSize returning -1 in firefox


    Hi,
      always file.FileSize returning -1 in firefox


    function
    CuteWebUI_AjaxUploader_OnSelect(files)

    {

    for(var i=0;i<files.length;i++)

    {

    var file=files[i];

     if(file.FileSize!=-1)

    {

     if(file.FileSize>2147483648)

    {

    alert(file.FileName+ " ( " + Math.round((file.FileSize/1073741824)*Math.pow(10,2))/Math.pow(10,2) +"GB ) is too large. The maximum file size allowed is 2GB");

    return false;

    }

    }

    }

    }

    Regards
    Arun,
    Filed under:
  •  05-11-2009, 8:26 AM 52036 in reply to 52033

    Re: file.FileSize returning -1 in firefox

    Arun,
     
    It will get -1 for IFrame mode.
     
    Please use server side validation too.
     
    check the FileValidating event, throw an exception there if you want to cancel it.
     
    Regards,
    Terry
View as RSS news feed in XML