Upload multiple files into SQL – vb.net and Asp.net
New DiscussionHola,
I need to upload a multiple files into SQL database as Varbinary, with the ASP.net Upload file, I’m using the following code, how can I do it with the Infragistics upload file?
Dim img As FileUpload = CType(ASPFileUpload, FileUpload)
Dim imgByte As Byte() = Nothing
If img.HasFile AndAlso Not img.PostedFile Is Nothing Then
'To create a PostedFile
Dim File As HttpPostedFile = ASPFileUpload.PostedFile
'Create byte Array with file len
imgByte = New Byte(File.ContentLength - 1) {}
'force the control to load data in array
File.InputStream.Read(imgByte, 0, File.ContentLength)
cmd.Parameters.AddWithValue("@vtype", Path.GetExtension(ASPFileUpload.FileName).ToLower)
cmd.Parameters.AddWithValue("@vatt", imgByte)
End If
Sign In
to post a reply
Replies
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Favorites
0 Replies
1 Created On
Feb 16, 2022 Last Post
4 years ago