in c#
protected void btnUpload_Click(object sender, EventArgs e)
{
string fileName = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
FileUpload1.PostedFile.SaveAs(Server.MapPath("~/Uploads/" + fileName));
}
in VB
Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim fileName As String = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName)
FileUpload1.PostedFile.SaveAs(Server.MapPath(("~/Uploads/" + fileName)))
End Sub
protected void btnUpload_Click(object sender, EventArgs e)
{
string fileName = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
FileUpload1.PostedFile.SaveAs(Server.MapPath("~/Uploads/" + fileName));
}
in VB
Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim fileName As String = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName)
FileUpload1.PostedFile.SaveAs(Server.MapPath(("~/Uploads/" + fileName)))
End Sub
No comments:
Post a Comment