Uploading Files with the HTML Input File Control (VB.net) : File Upload « Components « ASP.Net






Uploading Files with the HTML Input File Control (VB.net)

<%@ Page Language=VB Debug=true %>
<script runat=server>
Sub SubmitButton_Click(Source As Object, e As EventArgs)
'   Not working 
'   Change the following folder as your settings
'    MyFile.PostedFile.SaveAs("./" & txtFileSaveAs.Value)
    TheMessage.InnerHTML = "File uploaded!"
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Uploading Files with the HTMLInputFile Control</TITLE>
</HEAD>
<BODY>
<form 
    enctype="multipart/form-data" 
    runat="server">
Enter the name and path of the file to upload:
<BR>
<input 
    id="MyFile" 
    type="file" 
    runat="server"
>
<BR><BR>
Enter the name only to save the file as: <BR>
<input 
    id="txtFileSaveAs" 
    type="text" 
    runat="server"
>
<BR><BR>
<span 
    id="TheMessage"
    runat="server"
>
</span>
<BR><BR>
<input 
    runat="server"
    type=button 
    value="Upload" 
    OnServerClick="SubmitButton_Click" 
>
</Font>
</Form>
</BODY>
</HTML>
           
       








Related examples in the same category

1.Upload File control (C#)
2.File Upload Demo (C#)
3.File Uploading in ASP.NET (VB.net)
4.Upload file to the server (VB.net)