Only file with these extension(.jpg, .png, .gif) is allowed how can I cancel an ongoing AsyncFileUpload so that the client function OnClientUploadComplete is not called
Even if I check in this event handler method AsyncFileUpload1_OnUploadedComplete and do return if wrong
file extension has been selected the client function OnClientUploadComplete is still called
protected void AsyncFileUpload1_OnUploadedComplete(object sender, AsyncFileUploadEventArgs e)
{
string id = Request.QueryString["ID"];
//Here I went to check rhat a file with correct extension has been selected
//if (Path.GetExtension(FileUploadBild.FileName).ToLower() != ".jpg" &&
// Path.GetExtension(FileUploadBild.FileName).ToLower() != ".png" &&
// Path.GetExtension(FileUploadBild.FileName).ToLower() != ".gif")
//Copy file to temp folder
AsyncFileUpload1.PostedFile.SaveAs(path + e.FileName);
path += e.FileName;
//Upload image to ftp server
FileManager.HandleUpload(path, id);
//Update database
backEnd.InsertIntoPictures(id, AsyncFileUpload1.FileName);
}
//Tony