System.Web Namespace HttpPostedFile Class
Gets the size in bytes of an uploaded file.
[ VB ]
Public ReadOnly Property ContentLength As Integer
[ C# ]
public int ContentLength {get;}
[ C++ ]
public: __property int get_ContentLength ( );
[ JScript ]
public function get ContentLength ( ) : int;
The length of the file.
The following example shows the simplest way to retrieve and display the ContentLength property of an uploaded file. In the sample, an HtmlInputFile control named myUploader is used to enable selection of a file from the client's machine.
myUploader.PostedFile.ContentLength
Show me
HttpPostedFile Members HttpFileCollection Class