web 2.0

ASP.NET(vb.net) & HTMLInputFile

ASP.NET(vb.net) & HTMLInputFile - HTMLInputFile : Creates a server-side control that maps to the <input type=file> HTML element and allows you to upload a file to the server.

ShotDev Focus:
- ASP.NET(vb.net) & HTMLInputFile

ASP.NET(vb.net) & HTMLInputFile

Tag Control :

<input type=file
id="programmaticID"
accept="MIMEencodings"
maxlength="maxfilepathlength"
size="widthoffilepathtextbox"
postedfile="uploadedfile"
runat="server" >

Example

HTMLInputFile.aspx

<%@ Page Language="VB" %>
<script runat="server">

Sub Button1_OnClick(sender As Object, e As EventArgs)
If Not IsNothing(File1.PostedFile) Then
Dim strFileName = System.IO.Path.GetFileName(File1.Value)
Me.lblText1.Text = strFileName & " Uploaded."
File1.PostedFile.SaveAs(Server.MapPath("Myfiles/"&strFileName))
End If
End Sub

</script>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<form runat="server" enctype="multipart/form-data">
<input id="File1" type="file" runat="server">
<input id="Button1" type="button" OnServerClick="Button1_OnClick"  value="Button" runat="server" />
<hr />
<asp:Label id="lblText1" runat="server"></asp:Label>
</form>
</body>
</html>

Screenshot

ASP.NET(vb.net) & HTMLInputFile
.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.