Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Answer
how to upload default image into database
parthiban karnan
11y
1.4k
1
Reply
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));
}
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Problem with the Static Datatable? any help asap pls?
Asp.Net with Ajax