This blog is about the dotnet.all types of codes,news about dotnet including asp.net,vb.net,c# and know about new dotnet technology.programing in asp.net,vb.net,c#, ajax, AJAX tech support for .net and discuss the new technology in dotnet.ncluding asp.net,vb.net,c# and know about new dotnet technology.programing in asp.net,vb.net,c#, ajax, AJAX tech support for .net and discuss the new technology in dotnet.asp.net programming,dot net programming,dotnet programs,dotnet source code,source code.

Free Hosting

Free Hosting

Sunday, November 2, 2008

Storing a uploaded file in binary format in a database(ASP.NET CODE)

This shows you how To upload a file In binary format to a database

CODE:
''''''''''btnupload click is the fileupload button
'''''VB.NET
Private Sub btnUpload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpload.Click

If FileInput.PostedFile Is Nothing Then
lblError.Text = "No file specified."
Else
If FileInput.PostedFile.ContentLength > 2097152 Then ' 2097152 Bytes = 2 MB
lblError.Text = "File size cannot exceed 2 MB."
Return
End If


Dim byteFile As Byte()
''''' look fro code here for this function
byteFile = GetByteFromPostedFile(FileInput.PostedFile)
''''store to database
Storetodatabase(filename,byteFile)

End Sub

0 comments:

dotnet(.Net) Project Source code Downloads and Tutorials

Email Subscrption



Enter your email address:

Delivered by FeedBurner

Feedburner Count

Blog Archive

Unique Visitor

Design by araba-cı | MoneyGenerator Blogger Template by GosuBlogger