hi all
i have this code below to check file type only jpg and 1 MB to be allowed to upload
if (fuimage.HasFile)
{
string fileExt =
System.IO.Path.GetExtension(fuimage.FileName);
if (fileExt == ".jpeg" || fileExt == ".jpg")
{
//do what you want with this file
if (fuimage.PostedFile.ContentLength >= 1024)
{
String filepath = Server.MapPath("~/Admin/Em_Photo/" + fuimage.FileName);
fuimage.SaveAs(filepath);
}
else
{
lblStatusMsg.Text = "big file";
}
}
else
{
lblStatusMsg.Text = "Only .jpeg files allowed!";
}
}
else
{
lblStatusMsg ...
Go to the complete details ...