<script language="VB" runat="server">
Sub Button1_Click(Source As Object, e As EventArgs)
If Text1.Value = "" Then
Span1.InnerHtml = "Error: you must enter a file name"
Return
End If
If Not (File1.PostedFile Is Nothing) Then
Try
File1.PostedFile.SaveAs(("c:\temp\" + Text1.Value))
Span1.InnerHtml = "File uploaded successfully to <b>c:\\temp\\" & _
Text1.Value & "</b> on the Web server"
Catch exc As Exception
Span1.InnerHtml = "Error saving file <b>c:\\temp\\" & _
Text1.Value & "</b><br>" & exc.ToString()
End Try
End If
End Sub 'Button1_Click
</script>