Abdalla Elawad

Abdalla Elawad

  • NA
  • 1k
  • 211.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);
 

Answers (2)