Skip to content

Infragistics Community Forum / Desktop / Ultimate UI for ASP.NET Web Forms / Upload multiple files into SQL – vb.net and Asp.net

Upload multiple files into SQL – vb.net and Asp.net

New Discussion
CIS EUBAM-LIBYA
CIS EUBAM-LIBYA asked on Feb 16, 2022 6:43 AM

Hola,

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

  • 0
    Ivan Kitanov
    Ivan Kitanov answered on Feb 16, 2022 6:43 AM

    Hello,

    I have prepared a small sample application which demonstrates the use of the WebUpload control. Please note that in order to use the WebUpload you would need some additional configuration, which involves the addition of some css and javascript files required for the use of Ignite UI for JQuery, which is mandatory for the use of the WebUpload. You would also need to add some appSettings as well as some system.webServer configurations in the web.config file. To learn more about this please review the following page.

    Once a file is uploaded the OnUploadFinished could be used to obtain different details for the file, such as FileName, FolderPath, FileSize etc. These properties could be used for the file operations similar to how you are using the native ASP FileUpload.

    Please let me know if you have any questions.

    Regards,
    Ivan Kitanov

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
CIS EUBAM-LIBYA
Favorites
0
Replies
1
Created On
Feb 16, 2022
Last Post
4 years ago

Suggested Discussions

Created by

Created on

Feb 16, 2022 6:43 AM

Last activity on

Feb 19, 2026 9:30 PM