Check Extension File Uploaded File.

Jayakumars
Posted by Jayakumars under ASP.NET AJAX category on | Points: 40 | Views : 877
protected void bt_Upload_Click(object sender, EventArgs e)
{
if (Fp1.HasFile)
{
string Fup1 = Fp1.PostedFile.FileName;
string fup2 = Path.GetExtension(Fup1);

if (fup2 == ".jpg" || fup2 == ".gif" || fup2 == ".txt")
{
Label2.Text = "Select File Extension is In Correct";
}
else
{
Label2.Text = "Select File Extension is Correct";
}

}
}

Comments or Responses

Login to post response