I just cut and pasted a script that I found in the MSDN library, just to try it out. Its very basic and I asumed it is correct. Here it is:
<script runat="server">
void UploadBtn_Click(Object sender, EventArgs e)
{
MyFile.PostedFile.SaveAs("e:\\wwwroot\\omrin\\uplo ad");
}
</script>
<body>
<form action="fileupload.aspx"
method="post"
enctype="multipart/form-data"
runat="server" ID="Form1">
<h1>ASP.NET File Upload Example</h1>
Select File To Upload to Server:
<input id="MyFile"
type="file"
runat="server" NAME="MyFile">
<br><br>
<input type=submit
value="Upload!"
OnServerclick="UploadBtn_Click"
runat="server" ID="Submit1" NAME="Submit1">
</form>
Gerhard Wentink
|