473,778 Members | 2,804 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Download Large data

Hi EveryBody:

I have the following code to download the data from my web application:

the code is:

Dim rawan As New List(Of String) ' for File Name
Dim rawan1 As New List(Of Byte()) ' for the data for each file
Dim objconn As SqlConnection = New
SqlConnection(C onfigurationMan ager.Connection Strings("Husam" ).ConnectionStr ing)
Try
Dim objcom As SqlCommand
objcom = New SqlCommand("SEL ECT * FROM " + s, objconn)
objconn.Open()
Dim myread As SqlDataReader =
objcom.ExecuteR eader(CommandBe havior.CloseCon nection)
If myread.HasRows = True Then
While myread.Read()
rawan.Add(myrea d.GetValue(0))
rawan1.Add(myre ad.GetValue(1))
End While
Me.Response.Bin aryWrite(rawan1 (ListBox1.Selec tedIndex))
Dim husam As String = rawan(ListBox1. SelectedIndex)
Response.AddHea der("Content-Disposition", "attachment ; filename=" + husam)
End If
myread.Close()
objconn.Close()
Catch ex As Exception
Throw New Exception(ex.Me ssage)
objconn.Close()
End Try

when I run this code to download small data like 4MB it works well,but when
I use it to download large data for example let's say 345 MB there is an
error occure that tell me the SystemOutOfMemo ry.

I read about something called MaxResponseHead ersSize Property which I
though it Like MaxRequestLengt h that I used before to make my application
upload large data more than 4mb, but the requirments for this proprtey is
windows 2003 or 2000 server side and windows xp clinte side.

So is there some body can help me in this problem?

any help or redirection will be apprediated

regard's

Husam
Feb 25 '08 #1
1 1696
the default is build the response in memory, then send it. with your large
size, you runout of memeory (see machine.config for max memory size))

if your response is this large you want to send it right away. turn page
bufferring off. you will need to write the headers before content. use
flush() to flush the buffers. also you will need to up the page timeout
(default 1 minute), because a download of this size may takes minutes (about
1 hour over dsl).

-- bruce (sqlwork.com)
"Husam" wrote:
Hi EveryBody:

I have the following code to download the data from my web application:

the code is:

Dim rawan As New List(Of String) ' for File Name
Dim rawan1 As New List(Of Byte()) ' for the data for each file
Dim objconn As SqlConnection = New
SqlConnection(C onfigurationMan ager.Connection Strings("Husam" ).ConnectionStr ing)
Try
Dim objcom As SqlCommand
objcom = New SqlCommand("SEL ECT * FROM " + s, objconn)
objconn.Open()
Dim myread As SqlDataReader =
objcom.ExecuteR eader(CommandBe havior.CloseCon nection)
If myread.HasRows = True Then
While myread.Read()
rawan.Add(myrea d.GetValue(0))
rawan1.Add(myre ad.GetValue(1))
End While
Me.Response.Bin aryWrite(rawan1 (ListBox1.Selec tedIndex))
Dim husam As String = rawan(ListBox1. SelectedIndex)
Response.AddHea der("Content-Disposition", "attachment ; filename=" + husam)
End If
myread.Close()
objconn.Close()
Catch ex As Exception
Throw New Exception(ex.Me ssage)
objconn.Close()
End Try

when I run this code to download small data like 4MB it works well,but when
I use it to download large data for example let's say 345 MB there is an
error occure that tell me the SystemOutOfMemo ry.

I read about something called MaxResponseHead ersSize Property which I
though it Like MaxRequestLengt h that I used before to make my application
upload large data more than 4mb, but the requirments for this proprtey is
windows 2003 or 2000 server side and windows xp clinte side.

So is there some body can help me in this problem?

any help or redirection will be apprediated

regard's

Husam
Feb 25 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1311
by: Bryan McArdle | last post by:
How is the .NET Download Assembly Cache related to IE's Temporary Internet Files cache? We have a large app that we are deploying using .NET's No-Touch-Deployment capability to launch the app directly from a URL. Right now we are using a small stub .EXE that uses an Assembly.LoadFrom(URL) call to load the large DLL that holds the majority of the application. After the first download of the .EXE and ..DLL, subsequent visits to the URL...
5
3379
by: Thomas Andersson | last post by:
Hi, I am trying to find a working solution for download of large files (400-800 MB)... But this seems almost impossible to find a working example. I have tried Response.Transmitfile, this works for some people…but in my case the server reset the connection after approx. 20 minutes and sometimes after 7-8 minutes…the download speed is however very good 400MB takes about 10
1
1837
by: Al Cadalzo | last post by:
I have a web page that allows a user to download data by clicking on a link button. I then use Aspose.Excel (v1.0.3705) to generate the file for download and then I call the "Save" method on the Aspose.Excel object to send it to the Response object. One of our users has Norton Firewall installed and when he tries to download a large amount of data he gets a message ""0 bytes downloaded". It works OK with smaller files. When he disables...
2
1783
by: VBTricks.de.vu Webmaster | last post by:
Hello everybody, I need to write a HTTP client capable of downloading files using the HTTP protocoll. But downloading is one of my problems. I'm new to VB.net and I know there's a framework offering a solution for almost every problem. But for me it's a bit complex. So what I need: I need a way to download files asynchronously. In VB6 I solved this problem with a self-written component using sockets. As of the large
2
1395
by: Loane Sharp | last post by:
Hi there I'm downloading data from a remote server to my local disk using Stream.Read() and Stream.Write() (as previously suggested by Ken Tucker in this group). By and large the download and local write operations occur successfully, but frequently the data transfer is "intermittent", ie. sometimes the connection to the server becomes idle and no data transfer occurs over the wire. The code eventually resumes execution as if all the...
6
2715
by: Jatin | last post by:
Hey Guys I have a web application that allows users to download files. But the files are not hosted on the webserver. The files are stored on external servers and are referenced by a URL/URI. Since my application restricts the number of downloads for the file per user, i cannot show the user the URL/URI of the server hosting the file. Therefore i need to some how route the file via my webserver, and then use the Response to stream the...
13
51716
by: ron1972 | last post by:
Hi I have a large pdf file that if I create an anchor link to, the browser will try to open the file, which takes quite a long time. Is there a way to force the browser to download the file rather than try to open it? Thankss
0
1218
by: NutsAboutVB | last post by:
Basically, the title explains it. I want to be able to read the first n bytes (say, 1024 bytes) of any file (text or binary) off the internet in my vb.net application. I specifically do not want to download the whole file (which in most cases will be significantly large compared to the portion i do want). I've looked into system.net.webclients only to find that the OpenReadAsync methods doesn't even have a ProgressChanged event, and...
2
1743
by: jwf | last post by:
I am developming a web application in ASP.NET (VB) and am looking to develop functionality where a user clicks on a link to download a file but at no point can the user see the actual URL link to the file. When the file is originally uploaded to the webserver it will be given a unique random filename and the link to the file + description sill be stored in sql server. Basically the system must be secure so that a user MUST go through...
0
9629
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10068
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8954
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7474
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5497
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4031
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2863
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.