Abdalla Elawad

Abdalla Elawad

  • 1.1k
  • 1k
  • 102.8k

how can i save image in folder on server

Jan 19 2020 2:01 PM
hi guys
please support me , i am facing problem when i started my project in my localhost its saving okay but when i transfer this project on my another server to publish this system i cant not save any image . 
 
this is code 
 
string str = FileUpload1.FileName;
//string str2 = FileUpload2.FileName;
FileUpload1.PostedFile.SaveAs(Server.MapPath("~/Images/" + str));
//FileUpload2.PostedFile.SaveAs(Server.MapPath("~/Images/" + str2));
string IqamaCopy = "~/Images/" + str.ToString();
// string IqamaCopy = "~/Images/" + str2.ToString();
SqlCommand cmd = new SqlCommand("Visitor_Insert", Conn);
cmd.Parameters.Add("@IqamaIdNo", SqlDbType.NVarChar).Value = txtIdIqama.Text.Trim();
cmd.Parameters.Add("@Reason", SqlDbType.NVarChar).Value = txtarea.Value.Trim();
//cmd.Parameters.AddWithValue("@PassportCopy", PassportCopy);
cmd.Parameters.AddWithValue("@IqamaCopy", IqamaCopy);
 

Brought to you by: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.

Answers (2)