|
|
|||||||
| Windows Web Hosting Discussion Forum Discussion Forum on Windows Web Hosting Related Support Issues. Discuss your Issues related to ASP.NET, MS SQL, ASP, DLL, Components, etc... |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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() + " KB)");
__________________
Strat with Linux || Optimize, Secure and increase performance of Apache || Already Started The visionary conceives the impossible, The missionary makes it possible. ...Gita. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ASP.net medium trust level | Manuel_ | TroubleShooting | 1 | 07-08-2006 02:06 AM |
| upload the dump file from PHPMyAdmin | Manuel_ | Control Panel Discussion Forum and Support - CPANEL - HELM | 0 | 06-25-2006 11:07 AM |
| How to use ASP Simple Upload Component? | Manuel_ | General Discussions | 0 | 06-22-2006 01:36 AM |
| How can I get my site changed from asp.net 1.1 to 2.0? | nancy_accu | Windows Web Hosting Discussion Forum | 0 | 06-20-2006 03:56 PM |
| asp.net v.2.0 | wlambrechts | Windows Web Hosting Discussion Forum | 2 | 07-11-2005 01:34 AM |