i have a file upload control. Please how do i specify a file size and file tyoe to be uploaded. Its very urgent

Recommended Answers

That happens by itself, why do you want to specify the file size. The control takes care of the same.

Jump to Post

All 4 Replies

That happens by itself, why do you want to specify the file size. The control takes care of the same.

You have to specify file size so the user does not try to ulpoad a file larger than what the file-Upload control can handle. Besides, it helps in memory management of your server

>how do i specify a file size

Use FileUpload1.FileBytes.Length property

> file tyoe to be uploaded.

Have a look at FileUpload1.PostedFile.ContentType

if(FileUpload1.PostedFile.ContentType=="image/jpg")
  {

  }

adatapost, thanks a lot but am sure you meant:

if (fileUpload1.PostedFile.ContentType==""image/JPEG") Then 
'
'
'
End If
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.