Anuradha Chavan

Anuradha Chavan

  • NA
  • 37
  • 16.3k

How to save uploaded image data back to computer?

Feb 14 2014 6:12 AM
Hello Friends,
I am working on a windows application that will store customer data along with image,
I have done the part of uploading a image. Now I want to write a code that will work as like download link in web applications.
How to save uploaded  image data back to computer?
Here is code i used for upload
 
private void btnUpload_Click(object sender, EventArgs e)
{
try
{
string str = ConfigurationManager.ConnectionStrings["MySampleDBConnectionString"].ConnectionString.ToString();
SqlConnection con = new SqlConnection(str);
OpenFileDialog open = new OpenFileDialog();
open.Filter = "Image Files(*.jpeg;*.bmp;*.png;*.jpg)|*.jpeg;*.bmp;*.png;*.jpg";
if (open.ShowDialog() == DialogResult.OK)
{
txbImg.Text = open.FileName;
pictureBox1.Image = new Bitmap(open.FileName);
}
btnSave.Visible = true;
}
catch (Exception ex)
{
MessageBox.Show("Error" + ex.Message.ToString());
}
 
 
How to get it back and save to computer?