The file is sent from the file. If you need to save FUFile.PostedFile:
if (FUFile.PostedFile != null)
{
string tempVar = "~/res/Posts/" + FUFile.Value.ToString();
FUFile.PostedFile.SaveAs(Server.MapPath(tempVar));
}
Here you can check it out:
In the markup, I have this:
<input type="file" class="upload" runat="server" id="FUFile"/>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
In the code, I have this method:
protected void Button1_Click(object sender, EventArgs e)
{
if (FUFile.PostedFile != null)
{
string tempVar = "~/res/Posts/" + FUFile.Value.ToString();
FUFile.PostedFile.SaveAs(Server.MapPath(tempVar));
}
}
When I select the file and click the button, it uploads the file to the .. / res / Posts folder.

source
share