»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 databaseThis 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
|
|