By this Coding you can create File Uploader
and the is file will uploaded into Foder:-
Design Source Code:-
<form id="form1" runat="server">
<asp:FileUpload id="FileUploadControl" runat="server" />
<asp:Button runat="server" id="UploadButton" text="Upload"
onclick="UploadButton_Click" />
<br /><br />
<asp:Label runat="server" id="StatusLabel" text="Upload
status: " />
</form>
Coding C#:
protected void UploadButton_Click(object sender, EventArgs e)
{
if(FileUploadControl.HasFile)
{
try
{
string filename = Path.GetFileName(FileUploadControl.FileName);
FileUploadControl.SaveAs(Server.MapPath("~/Folderpath") + filename);
StatusLabel.Text = "Upload status: File uploaded!";
}
catch(Exception ex)
{
StatusLabel.Text = "Upload status: The file could not be uploaded.
The following error occured: " + ex.Message;
}
}
}
nice work bro carry on.....
ReplyDeletethank you sir...
ReplyDelete
ReplyDeletehttps://rehabgad.edublogs.org/
https://prokr123.webnode.com/
http://rehabgad.over-blog.com/
http://nv2it.org/
https://www.prokr.net/ksa/jeddah-water-leaks-detection-isolate-companies/