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
Regular expression for file size in asp.net?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Bhilendra Yede9 reputationPosted Aug 19, 2010, 2:28 AM EDT
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 sasidhar17 reputationPosted Aug 19, 2010, 3:50 AM EDT