hi,
in my web application i am restricting the user not to upload the above 10 mb file how can i write regular expression for this. can u help me
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bhilendra YedePosted Aug 19, 2010, 6:28 AM
ErrorMessage="File size should not be greater than 1 KB." OnServerValidate="CustomValidator1_ServerValidate">
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
if (fuFile.FileBytes.Length > 1024) // 1024*KB of file size
{
args.IsValid = false;
}
else
{
args.IsValid = true;
}
}
surya sasidharPosted Aug 19, 2010, 7:50 AM