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
Post a Comment