asp.net.ph

HttpPostedFile.ContentLength Property

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;

Property Value

The length of the file.

Example

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 

See Also

HttpPostedFile Members   HttpFileCollection Class Skip Navigation Links


Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note