Uploading Large data

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?SHVzYW0=?=

    Uploading Large data

    Hi Every Body:

    I have the following code that work fine with me when I load data thier size
    just 5 mb but when I move for 10mb or 20mb or 100mb it did not work with me?

    My code is:

    Dim arrayImage() As Byte = FileUpload1.Fil eBytes
    TextBox1.Text = FileUpload1.Fil eName
    Dim nStr As String =
    Me.TextBox1.Tex t.Substring(Me. TextBox1.Text.L astIndexOf("\") + 1)
    Dim scon As SqlConnection = New
    SqlConnection(C onfigurationMan ager.Connection Strings("Husam" ).ConnectionStr ing)
    Dim sql As String = "INSERT INTO MyTable(Name,Pi c)" +
    "VALUES(@Filena me,@Picture)"
    Dim cmd As New SqlCommand(sql, scon)
    With cmd
    .Parameters.Add (New SqlParameter("@ Filename",
    SqlDbType.NVarC har, 50)).Value = nStr
    .Parameters.Add (New SqlParameter("@ Picture",
    SqlDbType.Image )).Value = arrayImage
    End With
    scon.Open()
    cmd.ExecuteNonQ uery()
    scon.Close()

    Can Some body help in Uploading data more than 10mb or 20mb or even more
    than 100 mb?

    any help or redirection will be appreciated

    regard's

    Husam
  • Phil H

    #2
    Re: Uploading Large data

    The cause of the problem may well be this line of code:
    Dim arrayImage() As Byte = FileUpload1.Fil eBytes
    Which puts the whole file content into server memory at once and may
    be causing resource problems epsecially if the site is using shared
    hosting.

    Comment

    Working...