By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,658 Members | 1,908 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,658 IT Pros & Developers. It's quick & easy.

Help, Why can't upload file from normal html form ?

P: n/a
In, 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">
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
Oct 1 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.