parthiban karnan

parthiban karnan

  • NA
  • 549
  • 101.3k

how to upload default image into database

May 9 2013 2:28 AM

i have to insert default image into databse..when no image is selected from fileupload control..

code...not working for inserting  default image...

if (FileUpload1.HasFile)
{
string FileName = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
FileUpload1.SaveAs(Server.MapPath("~/UPLOADEDFILES/" + FileName));
feedBack.Attachments.Add(new Attachment(FileUpload1.PostedFile.InputStream, FileName));
}

else
{
string filename="~/images/"+ "sun.gif";
filename.pPropertyImage = filename;
FileUpload1.SaveAs(MapPath(filename));



}


Answers (1)