protected void ButtonUpload1_Click(object sender, EventArgs e)
{
if (FileUpload1_1.HasFile)
{
string path = FileUpload1_1.FileName;
int length = path.Length;
path = path.Substring(length - 4, 4);
string foto1 = Guid.NewGuid().ToString() + path;
FileUpload1_1.SaveAs(Server.MapPath("~/ApartmentImages\" + foto1));
FileUpload1_1.Visible = false;
LabelSuccess1_1.Text = "Başarılı ...";
HiddenFieldPhoto1_1.Value = "~/ApartmentImages/" + foto1;
}
if (FileUpload1_2.HasFile)
{
string path = FileUpload1_2.FileName;
int length = path.Length;
path = path.Substring(length - 4, 4);
string foto2 = Guid.NewGuid().ToString() + path;
FileUpload1_2.SaveAs(Server.MapPath("~/ApartmentImages\" + foto2));
FileUpload1_2.Visible = false;
LabelSuccess1_2.Text = "Başarılı ...";
HiddenFieldPhoto1_2.Value = "~/ApartmentImages/" + foto2;
}
if (FileUpload1_3.HasFile)
{
string path = FileUpload1_3.FileName;
int length = path.Length;
path = path.Substring(length - 4, 4);
string foto3 = Guid.NewGuid().ToString() + path;
FileUpload1_3.SaveAs(Server.MapPath("~/ApartmentImages\" + foto3));
FileUpload1_3.Visible = false;
LabelSuccess1_3.Text = "Başarılı ...";
HiddenFieldPhoto1_3.Value = "~/ApartmentImages/" + foto3;
}
if (FileUpload1_4.HasFile)
{
string path = FileUpload1_4.FileName;
int length = path.Length;
path = path.Substring(length - 4, 4);
string foto4 = Guid.NewGuid().ToString() + path;
FileUpload1_4.SaveAs(Server.MapPath("~/ApartmentImages\" + foto4));
FileUpload1_4.Visible = false;
LabelSuccess1_4.Text = "Başarılı ...";
HiddenFieldPhoto1_4.Value = "~/ApartmentImages/" + foto4;
}
ButtonUpload1.Visible = false;
}
Atam izindeyiz..
Biz de Fenerbahçeliyiz..
|