473,609 Members | 1,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to reduce the time to download file from server using HTTP connection

27 New Member
Hi,

I m facing some critical problem for downloading 5mb file from server. Does anyone know?



How to reduce the time to download file from server using HTTP connection?



Code I m using is


Expand|Select|Wrap|Line Numbers
  1. HttpConnection URLConn = (HttpConnection) Connector.open(originURL + fileName);
  2.  
  3.         if (URLConn == null) {
  4.  
  5.             URLConn.close();
  6.  
  7.             return;
  8.  
  9.         }
  10.  
  11.         int length = (int) URLConn.getLength();
  12.  
  13.  
  14.  
  15.         // variables to read the origin file
  16.  
  17.         inputStream = URLConn.openInputStream();
  18.  
  19.         try {
  20.  
  21.             fileCon = (FileConnection) Connector.open(DEVICE_PATH + fileName, Connector.READ_WRITE);
  22.  
  23.             if (!fileCon.exists()) {
  24.  
  25.                 fileCon.create();
  26.  
  27.             }else{
  28.  
  29.                 fileCon.delete();
  30.  
  31.                 fileCon.create();
  32.  
  33.             }
  34.  
Thanks in advance.

Thanks,
Vikas Sawant.
Mar 31 '09 #1
1 2772
JosAH
11,448 Recognized Expert MVP
You only showed us the preamble of the entire process; your connection speed is the most important factor for the downloading time here. Try to read 4KB or so blocks every time.

kind regards,

Jos
Mar 31 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
3359
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
5861
by: Vasu | last post by:
Hi, I have a requirement to download a file from the web site using a client tool. Iam writing a C# program to download using WebRequest, HttpRequest, WebResponse and so on. The problem Iam having is to navigate thru multiple pages. I have to login
1
1207
by: UJ | last post by:
My client has a product that downloads files from it's web server. It then will display these on a local machine. Problem is that this is on the customer's network which means, depending on the customer, they may have secured the network down like crazy. To the point that may have no open ports, can't send data across to our server, ... My network engineer has essentially said we need to have the following criteria: 1. We can't hard...
14
2074
by: Harry Keck | last post by:
I have client side code that uses xmlhttp to make an asyncronous call to the server. This call really churns the server and can take a couple of minutes to finish. I have found that while this long call is processing, I can not make any more requests to the server from the same session. I found this because if I have two completely separate instances of IE, they will not block each other, but if I do a File/New to spawn a separate...
7
3377
by: John | last post by:
We have created a game and when the user click on "Download New Songs" which requires the user to download songs. This could be over 20 songs. I have these files zipped on the server in one *.zip file. Is there any c++ code, or library that could help me do the following. Download zip file to users computer. Unzip the file and extract the files into songs subdirectory.
2
23791
by: Dan D | last post by:
I have a large install file (an exe) on my web server that people download and install from. Looking at my log files, I see a lot of people downloading it, but no way to tell for sure if they completed the download or cancelled out before it completed. Is there any function in PHP that would allow the web server to send the file and detect a completion or cancellation? Or perpahs a javascript/PHP method? Any help would be greatly...
6
2834
by: Simon | last post by:
Dear reader, I have an Access application which works as back-end and front-end. In case it's running on a local PC it works perfect. If I install it on a server the response time is increasing drastically.
1
3285
by: replyrpatil | last post by:
What I am trying to do: I need to print a compact access report (font 6 size) created using RTF2 program developed by Stephen Lebans to generate a TIF image of custom size (5.5 in x 2.0 in) Problem Recreation : Download attached RAR file (http://download.yousendit.com/627919383AFAA7E3 ) Steps 1) Install RTF2 program created by Lebans 2) Install ZAN Image Printer (Virtual Printer) 3) Create Custom Paper Size ----...
2
7191
by: fepeacock | last post by:
I am breaking/interrupting my connection with the ftp server at present when doing a partial download of a file. I have a callback with retrbinary that raises an exception and ends the download. The problem is that the server is not notified and hangs. I cannot send any further commands and need to relogin to download further. Is there a way to still continue downloading without having to login again. My retrbinary function is: ...
0
8139
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...
0
8555
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8232
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
7024
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
6064
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
4032
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
4098
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2540
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
1
1686
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.