fileuplode control file uploda problem [modified]
-
i have this code to upload a file file is upload name is id of the field for unique but now when i go for this folder there is no file type show. i want that if i store .rar than show .rar, if user store .zip show .zip extension, if user store .png show .png how can i do this. plz some one help me? my code is given above plz check is its right or not and what made change to convert like i want. i got file extension but now i would like to know when i show this path in link button how to load client when click on this link plz some one help me in this topic. thanks in advance. :-D
protected void btn_add_issue1_Click(object sender, EventArgs e)
{
DataTable tbl1 = dt.filltbl("select * from tbl_issue where id=-1", "new1");
DataRow row1 = tbl1.NewRow();
row1["issue_id"] = ViewState["max"].ToString(); ;
row1["prefix"] = ViewState["prefix"].ToString();
row1["Project_id"] = Convert.ToInt32(ddl_projects.SelectedValue);
row1["project_name"] = Convert.ToString(ddl_projects.SelectedItem);
row1["issue_title"] = txt_issue.Text;
row1["issue_type"] = Convert.ToString(ddl_issue.SelectedItem);
row1["issue_desc"] = FreeTextBox1.Text;
row1["status"] = "Open";
row1["svdate"] = DateTime.Now.Date.ToShortDateString();
row1["svtime"] = DateTime.Now.ToShortTimeString();
tbl1.Rows.Add(row1);
dt.update(tbl1, "select * from tbl_issue");fillissueid(); FreeTextBox1.Text = ""; txt\_issue.Text = ""; object max = dt.getmax("select max(id) from tbl\_issue"); if (fu\_attachment.FileName != "") { DataTable tblco = dt.filltbl("select \* from tbl\_issue where id=" + max, "maxx"); DataRow r1 = tblco.Rows\[0\]; string a = Convert.ToString(max); string str = "~/Data1/"; str = Server.MapPath(str); str = str + a ; fu\_attachment.SaveAs(str); r1\["issue\_attach"\] = "~/Data1/" + a ; dt.update(tblco, "select \* from tbl\_issue"); } Page.RegisterStartupScript("myrest", "alert('New issue was added successfully');"); Response.Redirect("default.aspx"); }
:-D
I will do my best? Integrated Solutions, Bikaner (Raj.), India
modified on Monday, September 29, 2008 10:50 AM