Home | Articles|Namespace|Interview Questions|Tools|Jobs|Projects|Community
Asp.net Tutorials

»Dotnet Ads
»Message Boards
Message Boards
Dotnet Books

»Member Details
Register
Login
LogOut
Submit Code
Submit Jobs
Submit Projects

»Competition
Community
Winners
Prizes
Write For Us
Members

»Other Resources
Links
Dotnet Resources

Storing a uploaded file in binary format in a database

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


''''''''''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



Have a Question and dont know the answer post it below and get answers in minutes

Due to spam this feature is disabled
To get answers fast , make sure you enter a detailed subject for example: "DataGrid issues need answer" not "DataGrid"

Subject:

Catjegory Name:

Message:



© 2008 dotnetwatch.com -- Privacy policy