c# - File Upload path needed -


hi trying save path of file using fileupload . on clicking button want complete path user has selected file upload stored database. testing purposes using labels in code below connect data base.i need store path selected user , not file.

html

c# have been trying not working

 protected void button1_click(object sender, eventargs e)     {       string g = fileupload1.filename;        string b =convert.tostring(fileupload1.postedfile.inputstream);        //string filepath = path.getfullpath(fileupload1.filename.tostring());        label1.text = g;       label2.text =b;      } 

change code below:

protected void button1_click(object sender, eventargs e)     {       string g = server.mappath(fileupload1.filename);        string b =convert.tostring(fileupload1.postedfile.inputstream);        //string filepath = path.getfullpath(fileupload1.filename.tostring());        label1.text = g;       label2.text =b;      } 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -