473,385 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Having connection timeout problem when calling a php script while downloading a file from the same server.

Hi,
My dot net client downloads files and checks for any new files time to
time. The server is apache2.0.53 server. So what happens is that my
file download thing works fine if I dont try to call any page from the
server while downloading. If I try to call a single page while
downloading a file then the page request goes time out and the server
then closes the existing download stream and the client doestn't throw
any exception. So many a time I end up with incomplete downloaded file.
The server side code is in PHP and every thing like calling a page or
downloading a file is done by calling some PHP script.

What is the reason behind this type of behaviour.Has this anything to
do with PHP and server settings.
Thanx.

Jan 4 '06 #1
3 2764
On Wed, 04 Jan 2006 05:49:37 -0800, ju***********@gmail.com wrote:
My dot net client downloads files and checks for any new files time to
time. The server is apache2.0.53 server. So what happens is that my
file download thing works fine if I dont try to call any page from the
server while downloading.


How do you "call page while downloading"? Are you trying to open another
page in the same window? Have you tried disabling timeout (careful with
that!!!) in your script by using something like: set_time_limit(0) ?

--
http://www.mgogala.com

Jan 4 '06 #2
I am specifying the name to the dowload.php.

Here is the code:

function readfile_chunked($filename)
{
$chunksize = 256*1024; // how many bytes per chunk
$buffer = '';
$handle = fopen($filename, 'rb');
if ($handle === false) {
return false;
}
fseek($handle,0);
while (!feof($handle)) {
set_time_limit(0);
$buffer = fread($handle, $chunksize);
print $buffer;
sleep(1);
}
return fclose($handle);
}

When ever I call any other single page then it seems to wait for the
download stuff to complete, and eventually timed out if the download
thing takes long time.

Jan 6 '06 #3
Ahhhhhhhhhhh....
There is another problem. I have kept some files at the server for
testing purpose. There is one particular file arnd 3KB in size. I can
download other files fine(in case I dont access any other page in
between). But in case of that particular file the client disconnects
saying Unable to read data from transport connection. That means the
connection is being closed arbitrarily. But downloading other files
just works fine.
Need some help here.
Thanks.

Jan 6 '06 #4

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

Similar topics

2
by: Alex Smith | last post by:
Hi all, I have an application that uses Oracle's JDBC thin driver 9.0.x to have a nice, friendly chat with 8.1.x database. During this exchange the server rudely interrupts the conversation and...
2
by: Dicky Cheng | last post by:
Hi, I am using .net remoting technology. I set up a .net remoting client and server in IIS. When the client calls the server, the server will run a long duration method (30-60seconds). I have a...
3
by: kant | last post by:
stringA= "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;PWD=password;Initial Catalog=DB;Data Source=127.0.0.1;Connect Timeout=30" stringB = "Provider=Microsoft.Jet.OLEDB.4.0; Data...
9
by: AccessStarters | last post by:
Can anyone please help me simply connect to northwind? Maybe some logical steps that I may be missing? I have tried many tutorials and they all give similar connections to the one below. Dim...
1
by: just.starting | last post by:
Hi, My dot net client downloads files and checks for any new files time to time. The server is apache2.0.53 server. So what happens is that my file download thing works fine if I dont try to call...
5
by: supercooper | last post by:
I am downloading images using the script below. Sometimes it will go for 10 mins, sometimes 2 hours before timing out with the following error: Traceback (most recent call last): File...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
6
by: =?Utf-8?B?VGlt?= | last post by:
I have an app that calls a webmethod. Everything works fine except when you, the client, loses network connectivity during the request. When the connection is lost the client applications hangs. ...
5
by: This | last post by:
I have a pretty basic emailing script that sends a relatively small number (150) of html emails. The emails are compiled, personalised from a mysql db subscribers list, and sent using mail() -...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.