<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="FileUpload" %>
Untitled Page
File: Default.aspx.cs
using System;
using System.Configuration;
using System.Collections;
using System.Data;
using System.IO;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class FileUpload : System.Web.UI.Page
{
protected void btnUpload_Click(object sender, EventArgs e)
{
string htmlFilePath = fupHtmlUpload.PostedFile.FileName;
string aspNetFilePath = fupAspNetUpload.PostedFile.FileName;
string filePath = fupAspNetUpload.FileName;
string fileName = Path.Combine(Server.MapPath("."), filePath);
fupAspNetUpload.SaveAs(fileName);
}
}