If you want to get the size of a file in ASP.NET (C#), check the below code:
string MyFile = "~/photos/mymug.gif";

FileInfo finfo = new FileInfo(Server.MapPath(MyFile));
long FileInBytes = finfo.Length;
long FileInKB = finfo.Length / 1024;

Response.Write("File Size: " + FileInBytes.ToString() +
" bytes (" + FileInKB.ToString() + " K");