folder uploadRavi Patel12yAsked May 3, 2014, 2:19 AM1.5kLearn iOS Programminghow to manually to set folder path in code behind for fileupload control, not to let to choose file for user with browse button
SRSasi Reddy12y agoPosted May 3, 2014, 6:01 AM string folder = "SasiReddy"; var fileName = Path.GetFileName(file.FileName); string path1 = Server.MapPath("~/Users/" + folder); var path = Path.Combine(path1, fileName); System.IO.Directory.CreateDirectory(path1); string path2 = "~/Users/" + folder + "/" + fileName; file.SaveAs(path); midocument.Name = fileName; midocument.Path = path2; db.MIDocuments.Add(midocument); db.SaveChanges();It will create a folder in a project
Ravi Patel12y agoPosted May 3, 2014, 2:48 AMthanks for rply but yr link is not useful for me i want to do like that supose path="C:\Users\user\Desktop\Newfolder" then how to assign this path to FileUpload Dim fuploader As New FileUpload()If (fuploader.HasFile) Thenfuploader.SaveAs("") End If
Lakshmanan Sethu Sankaranarayan12y agoPosted May 3, 2014, 2:40 AMHi, Please check this http://www.c-sharpcorner.com/uploadfile/kaps_deo/how-to-upload-and-download-the-files-from-the-web-server/
Munesh Sharma12y agoPosted May 3, 2014, 2:23 AMgo on this http://asp.net-tutorials.com/controls/file-upload-control/link
Sasi ReddyPosted May 3, 2014, 6:01 AM
var fileName = Path.GetFileName(file.FileName);
string path1 = Server.MapPath("~/Users/" + folder);
var path = Path.Combine(path1, fileName);
System.IO.Directory.CreateDirectory(path1);
string path2 = "~/Users/" + folder + "/" + fileName;
file.SaveAs(path);
midocument.Name = fileName;
midocument.Path = path2;
db.MIDocuments.Add(midocument);
db.SaveChanges();
It will create a folder in a project
Ravi PatelPosted May 3, 2014, 2:48 AM
i want to do like that
supose path="C:\Users\user\Desktop\Newfolder" then how to assign this path to FileUpload
Dim fuploader As New FileUpload()
If (fuploader.HasFile) Then
fuploader.SaveAs("")
End If
Lakshmanan Sethu SankaranarayanPosted May 3, 2014, 2:40 AM
Munesh SharmaPosted May 3, 2014, 2:23 AM