ASP.NET FileUpload control
1 Answer
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
Parveen SiwachRank #6,758 · 257 reputationPosted May 16, 2013, 4:38 AM EDT
<asp:FileUpload runat="server" Style="top: 15px; left: 142px; position: absolute;
height: 22px; width: 217px" ID="FileUpload1" />
<asp:Button ID="save" Text="Finish" runat="server" OnClick="save_Click" />
On Code behind:
On Clicking on Upload Button-
protected void save_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
FileUpload1.SaveAs(MapPath("~/LocalFolderPath/" + FileUpload1.FileName));
}
}
Hope this will be helpful for you.