file size

E

Eugene Anthony

The code bellow makes up part of my upload script build using asp.net
with c#:

string filename =
FileUpload1.PostedFile.FileName.Substring(FileUpload1.PostedFile.FileNam
e.LastIndexOf("\\") + 1);
string filetype = FileUpload1.PostedFile.ContentType;
int filesize = FileUpload1.PostedFile.ContentLength;

However I am facing a problem in terms of the filesize. It is not
accurate or the same as the actual file size. Huge difference in figure.
How do I find out the actual file size in kilobytes?

Eugene Anthony
 
G

Guest

The code bellow makes up part of my upload script build using asp.net
with c#:

string filename =
FileUpload1.PostedFile.FileName.Substring(FileUpload1.PostedFile.FileNam
e.LastIndexOf("\\") + 1);
string filetype = FileUpload1.PostedFile.ContentType;
int filesize = FileUpload1.PostedFile.ContentLength;

However I am facing a problem in terms of the filesize. It is not
accurate or the same as the actual file size. Huge difference in figure.
How do I find out the actual file size in kilobytes?

Eugene Anthony

*** Sent via Developersdexhttp://www.developersdex.com***

1 kilobyte = 1024 bytes
filesize / 1024
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top