Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6146385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:56:19+00:00 2026-05-23T18:56:19+00:00

Ultimately, what I would like to do is upload files directly into the database,

  • 0

Ultimately, what I would like to do is upload files directly into the database, so I updated this question with the code I’m using to write to the database.

I am developing a module in DotNetNuke using Telerik controls. I need to upload files to the server in the user interface, so I am using the RadUpload control and the RadProgressArea/RadProgressManager.

Here is my ASP:

<telerik:RadUpload ID="RadUpload1" runat="server" ControlObjectsVisibility="CheckBoxes, RemoveButtons, ClearButtons"
                AllowedFileExtensions=".doc,.docx,.pdf,.tiff,.gif,.jpg,.jpeg,.xls,.xlsx" MaxFileInputsCount="2"
                MaxFileSize="10000000" InitialFileInputsCount="2">
            </telerik:RadUpload>
            <br />
            <asp:Button ID="UploadButton" runat="server" Text="Upload File(s)" />
            <telerik:RadProgressArea ID="RadProgressArea1" runat="server" ProgressIndicators="TotalProgressBar, TotalProgress, RequestSize, FilesCountBar, FilesCount, SelectedFilesCount, CurrentFileName, TimeElapsed, TimeEstimated, TransferSpeed">
            </telerik:RadProgressArea>
            <br />
            <telerik:RadProgressManager ID="RadProgressManager1" Runat="server" />

And here is my VB:

   Protected Sub UploadButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles UploadButton.Click
    If RadUpload1.UploadedFiles.Count > 0 Then
        System.Threading.Thread.Sleep(3000)
    End If
    For Each file As UploadedFile In RadUpload1.UploadedFiles
        Dim bytes(file.ContentLength - 1) As Byte
        file.InputStream.Read(bytes, 0, file.ContentLength)
        Try
            ' Create the sales order in the database on page load so that the salesorderid is unique
            Dim connection As String = ConfigurationManager.ConnectionStrings("SiteSqlServer").ConnectionString
            Dim con As New SqlConnection(connection)
            Dim cmd As New SqlCommand("INSERT INTO TTC_UploadedFiles ([Name], [Size], [Content]) VALUES (?, ?, ?)", con)
            cmd.Parameters.AddWithValue("@Name", file.GetName())
            cmd.Parameters.AddWithValue("@Size", bytes.Length)
            cmd.Parameters.AddWithValue("@Content", bytes)
            con.Open()
            cmd.ExecuteNonQuery()
            con.Close()
        Catch ex As Exception
            Label1.Text = ex.ToString
        End Try
    Next
End Sub

When I hit the button, it does a postback to the page, but the files do not get uploaded. I tried using the autoupload functions and specifying pysical and virtual paths but that didn’t work. I did it exactly like they said. I manually registered the controls in my web.config, then removed them and used the auto-register feature to re-register thinking maybe I did something wrong, but I’m still at a loss.

Here’s where I spent the last couple hours:
[Upload Overview][3]
[Files are not uploaded][4]

Can someone help me get this upload control and progress indicator working?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:56:20+00:00Added an answer on May 23, 2026 at 6:56 pm

    This is not direct related to your question. I use AsyncUpload, which can select muliple files at once, and upload files to database. The following is the sample code. I strip out the validation codes for the sake of simplicity.

    <!-- ASPX page -->
    <telerik:RadProgressManager runat="server" ID="RadProgressManager1" />
    <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" InputSize="40" MaxFileSize="10485760">
    </telerik:RadAsyncUpload>
    <telerik:RadProgressArea runat="server" ID="RadProgressArea1">
    </telerik:RadProgressArea>
    
    // Code behind
    ImageManager.InsertImage(AsyncUpload1.UploadedFiles);
    
    // In business logic
    public static void InsertImage(UploadedFileCollection uploadedFileCollection)
    {   
       foreach (UploadedFile uploadedFile in uploadedFileCollection)
       {  
          string filename = uploadedFile.GetName();   
    
          // Process the image into byte array
          Stream imgStream = uploadedFile.InputStream;
          int imgLen = uploadedFile.ContentLength;
          byte[] imgBinaryData = new byte[imgLen]; 
          imgStream.Read(imgBinaryData, 0, imgLen);
    
          // Get width and height
          Image originalimg = Image.FromStream(imgStream);
    
          // Get rid of white spaces
          filename = string.Concat(Regex.Replace(Path.GetFileNameWithoutExtension(filename),
             "[^\\w-]", string.Empty), Path.GetExtension(filename));
    
          // Now you get - 
          // imgLen
          // filename
          // imgBinaryData
          // originalimg.Height;
          // originalimg.Width;
       }  
    }
    

    Edit: In web.config, depending on what IIS you are using.

    <httpHandlers>
      <add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler, Telerik.Web.UI"/>
    </httpHandlers>
    <httpModules>
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI"/>
    </httpModules>
    
    <modules>
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI" preCondition="integratedMode"/>
    </modules>
    <handlers>
      <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" verb="*" type="Telerik.Web.UI.Upload.RadUploadProgressHandler, Telerik.Web.UI" preCondition="integratedMode"/>
    </handlers>
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like this to be the ultimate discussion on how to check if
Ultimately, code compiles down (eventually) into instructions for a CPU. Code, however, (in my
This code produces a FileNotFoundException, but ultimately runs without issue: void ReadXml() { XmlSerializer
I have a controller that handles file uploads. Ultimately I would like to be
Currently I would simply like to find all files that have not been modified
I have a Java Applet that is generating an image. Ultimately, I would like
Ultimately, I would like to use Inflector.parameterize to create slugs for article heading that
Ultimately I would like to use a Java program to send and receive messages
would love your thoughts on this one. I am using jQuery autocomplete in a
I would like to create a similar system to the facebook status update using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.