Uploading Large data

H

Husam

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.FileBytes
TextBox1.Text = FileUpload1.FileName
Dim nStr As String =
Me.TextBox1.Text.Substring(Me.TextBox1.Text.LastIndexOf("\") + 1)
Dim scon As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrings("Husam").ConnectionString)
Dim sql As String = "INSERT INTO MyTable(Name,Pic)" +
"VALUES(@Filename,@Picture)"
Dim cmd As New SqlCommand(sql, scon)
With cmd
.Parameters.Add(New SqlParameter("@Filename",
SqlDbType.NVarChar, 50)).Value = nStr
.Parameters.Add(New SqlParameter("@Picture",
SqlDbType.Image)).Value = arrayImage
End With
scon.Open()
cmd.ExecuteNonQuery()
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
 
P

Phil H

The cause of the problem may well be this line of code:
Dim arrayImage() As Byte = FileUpload1.FileBytes

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top