In asp.net/c#, it's easy to implement Upload file to web server, just use
Request.Files or Request.InputStream & runat=server form and type=file input
controls. But now, it's a problem for me how to invoke a .aspx code to upload
file from a outer html file or c/s application.
I want to upload file by my small vb6.0 program using MS Winsock Control,
just invoke web server side file "UploadFile.aspx". So firstly, I used the
following "testUploadFile.htm" to test "UploadFile.aspx" :
content of testUploadFile.htm :
<form id="Form1" method="post" action="UploadFile.aspx" enctype =
"multipart/form-data" >
<INPUT id=uploadfile1 type=file size=49 >
<input type=submit value="submit">
</form>
In UploadFile.aspx, Not any "runat=server" control, just only following
simple codes in UploadFile.aspx.cs :
private void Page_Load(object sender, System.EventArgs e)
{
Response.Write("uploaded file(s) count: " +
System.Web.HttpContext.Current.Request.Files.Count .ToString());
}
But it always prompted "uploaded file(s) count: 0", just can't get any file.
Thanks for any suggestion!
David W