C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » ASP.NET WebForms »

Uploading Files in VB


Posted Date: 11 Oct 2009    Resource Type: Code Snippets    Category: ASP.NET WebForms
Author: hemantMember Level: Bronze    
Rating: 1 out of 5Points: 5



<%@ Page Language="VB" %>
<%@ Import Namespace="System.IO" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Sub UploadFile(ByVal s As Object, ByVal e As EventArgs)
If fileUpload.HasFile Then
Dim fileName As String = fileUpload.FileName
fileUpload.SaveAs(MapPath(fileName))
label.Text = "File " & fileName & " uploaded."
Else
label.Text = "No file uploaded!"
End If
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>
File Upload
</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:FileUpload ID="fileUpload" runat="server" />
<asp:Button ID="uploadButton" runat="server" Text="Upload!"
OnClick="UploadFile" />
<br />
<asp:Label ID="label" runat="server"></asp:Label>
</div>
</form>
</body>
</html>



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
File upload  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Flying text
Previous Resource: Simple Encrypt and Decrypt string using Securestring
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use