It is not an error but image is not getting uploded. plz help me....
File Not Supporting For ImageSystem.IO.FileNotFoundException: Could not find file 'C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Winter.jpg'. File name: 'C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Winter.jpg' at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) at BrowseImage.UIUtilities.ReadImageFile(String PostedFileName, String[] filetype) in e:\prashantcs\executed\Corporate Management\CorporateBasedCredential Cluster\UserControls\BrowseImage.ascx.cs
protected void btnShowImg_Click(object sender, EventArgs e)
{
HttpPostedFile postFile = this.Upload1.PostedFile;
string strFileName = this.Upload1.FileName;
try
{
if (this.Upload1.PostedFile != null)
{
if (string.IsNullOrEmpty(postFile.FileName))
lblMessage.Text = "Please select image to view";
else
{
imageData = UIUtilities.ReadImageFile(postFile.FileName, new string[] { ".gif", ".jpg", ".bmp", ".jpeg" });
if (imageData == null)
{
lblMessage.Text = "Please select a file of format gif, jpg or bmp.";
imgMyPhoto.Attributes.Add("Src", "");
}
else
{
Session["FileName"] = strFileName;
if (Session["Photo"] == null)
Session.Add("Photo", imageData);
else
Session["Photo"] = imageData;
imgMyPhoto.Attributes.Add("Src", Upload1.PostedFile.FileName);
}
}
}
}
catch (Exception ex)
{
lblMessage.Text = ex.Message;
}
}
[edit]Code copied from OP comment - OriginalGriff[/edit]