Posting a file to another aspx
I am trying to submit a posted file from one aspx to another. I am able to get data values, like textboxes in the form and filename of the file I`m uploading, but I don`t understand how to catch the datafile.
The aspx that is posteing a file would look something like this:
<form id="form1" runat="server">
<input type="file" id="image" name="picture"/>
<asp:textbox runat="server" id="Data"/>
<asp:button runat="server" id="buttonPost" Text="Click"/> <PostBackUrl="upload.aspx"/>
The file that recieves data could maybe look something like this, but how do I code this so that this c#-file can process the posted file?
protected void Page_Load(object sender, EventArgs e)
//this would fetch the filename I`m uploading
string testing1= Server.HtmlEncode(Request.Form["picture"]);
//This would get data entered in the textbox
string testing = Request.Form["Data"];
I am able to recieve text variables, but my problem is how to recieve the posted file. Is it possible to use Reques.Form or something to get this posted file?
Any clue anybody?