开发者

FileUpload control event

开发者 https://www.devze.com 2022-12-27 19:09 出处:网络
I want to know how to raise an event for fileupload control.... In my project, as soon as I select a file(Image) it should show FILENAME,EXTENSION & SIZE in the labels give开发者_开发问答n below.

I want to know how to raise an event for fileupload control.... In my project, as soon as I select a file(Image) it should show FILENAME,EXTENSION & SIZE in the labels give开发者_开发问答n below.

Pls reply me....

Thanks in advance.


Until HTML5 becomes mainstream, it is completely impossible to do this without uploading the entire file to the server. (Except maybe with Flash)


Unfortunately this is not possible you need first to upload the file and then get it's information and add them to labels, otherwise you need to use third party plug-in to able you to do that such as flash or java applets.


You can use this code to get file information as soon as you select the file.

int filesize = FileUpload1.PostedFile.ContentLength;
string fileextension = FileUpload1.PostedFile.ContentType
string filename = Path.GetFileName(FileUpload1.FileName);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号