Tue May 15, 2012 5:34 am
Wed May 16, 2012 12:30 am
<%@ Page Language="VB" %>
<script runat="server">
Protected Sub FunUploadFile(ByVal sender As Object, _
ByVal e As System.EventArgs)
If UploadParam.HasFile Then
Try
UploadParam.SaveAs("C:\Temp\" & _
UploadParam.FileName)
msgLabel.Text = "Name: " & _
UploadParam.PostedFile.FileName & "<br>" & _
" Size: " & _
UploadParam.PostedFile.ContentLength & " kb<br>" & _
"Content type: " & _
UploadParam.PostedFile.ContentType
Catch ex As Exception
msgLabel.Text = "err: " & ex.Message.ToString()
End Try
Else
msgLabel.Text = " No file specified...."
End If
End Sub
</script>
<html >
<head runat="server">
<title>Upload Files</title>
</head>
<body>
<form id="myForm" runat="server">
<div>
<asp:FileUpload ID="UploadParam" runat="server" /><br />
<br />
<asp:Button ID="Button1" runat="server" OnClick="FunUploadFile"
Text="Upload File" /> <br />
<br />
<asp:Label ID="msgLabel" runat="server"></asp:Label></div>
</form>
</body>
</html>
<html >
<head><title>
Upload Files
</title></head>
<body>
<form name="myForm" method="post" action="fileUpload.aspx"
id="myForm" enctype="multipart/form-data">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="Genereted Value" />
</div>
<div>
<input type="file" name="UploadParam" id="UploadParam" /><br />
<br />
<input type="submit" name="Button1" value="Upload File"
id="Button1" /> <br />
<br />
<span id="Label1"></span>
</div>
<div>
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION"
value="Genereted Value" />
</div></form>
</body>
</html>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.