Folder upload
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Munesh SharmaRank #174 · 13.9K reputationPosted May 2, 2014, 10:23 PM EDT
Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted May 2, 2014, 10:40 PM EDT
Ravi PatelRank #439 · 5.7K reputationPosted May 2, 2014, 10:48 PM EDT
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
Sasi ReddyRank #4,458 · 342 reputationPosted May 3, 2014, 2:01 AM EDT
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