473,394 Members | 1,173 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,394 software developers and data experts.

Download problem

Hello,
I'm using:
Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.7g PHP/5.0.4
MySQL 4.1.12
DocMan1.3RC1 (PHP based document manager)

I'm having following problem: file uploads OK, but problem occurs when I try to download or view the file.
After some innvestigation, I found out that only first 2MB od data is actually downloaded (exactly 2.000.000
bytes) resulting in corrupted files. (uploaded files are OK!)
I couldn't find that limit anywhere in my system. If the original filesize is under 2M, files are downloaded
and/or viewed correctly.
Firefox, Opera, IE6 - they all behave in the same way.
Win98, 2000, XP - the same

If I manualy fetch the files (bypassing DOCman), downloads is OK!

What am I missing here? I'm pretty sure it's PHP related, but I'm running out of ideas where to look.
Pls. help,
//Marin

Jul 17 '05 #1
3 1642
On Wed, 29 Jun 2005 09:04:35 +0200, Marin wrote:
Hello,
I'm using:
Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.7g PHP/5.0.4 MySQL 4.1.12
DocMan1.3RC1 (PHP based document manager)

I'm having following problem: file uploads OK, but problem occurs when I
try to download or view the file. After some innvestigation, I found out
that only first 2MB od data is actually downloaded (exactly 2.000.000
bytes) resulting in corrupted files. (uploaded files are OK!) I couldn't
find that limit anywhere in my system. If the original filesize is under
2M, files are downloaded and/or viewed correctly.
Firefox, Opera, IE6 - they all behave in the same way. Win98, 2000, XP -
the same

If I manualy fetch the files (bypassing DOCman), downloads is OK!

What am I missing here? I'm pretty sure it's PHP related, but I'm running
out of ideas where to look. Pls. help,
//Marin


Could this be a limit imposed by your ISP rather than your code? With it
being a solid 2000000 it seems possible. I haven't come across a php limit
communicating data across two servers in my work place and these
streams are much larger than 2M. I did this as an experiment to see if I
could come up with a better way to update remote servers, so I was working
with G byte tar-zip balls. (turned out to be far too slow for this purpose).

If it is that, I was going to suggest a way of breaking the file into
blocks with the file functions, but I am not sure how an ISP counts these
limits, it could be a limit in a single stream or a limit within a time
period.
Jul 17 '05 #2

"BearItAll" <sp**@rassler.co.uk> wrote in message news:pa****************************@rassler.co.uk. ..
Could this be a limit imposed by your ISP rather than your code?
Actually, it is not live system. I'm running it on local LAN. Thats what frustrates me even more.
It would be so much easier to blame it on ISP :) but since I'm responsible person in company....
With it
being a solid 2000000 it seems possible.

My thought exactly!

Thanx anyway
//Marin
Jul 17 '05 #3
Marin wrote:
Hello,
I'm using:
Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.7g PHP/5.0.4
MySQL 4.1.12
DocMan1.3RC1 (PHP based document manager)

I'm having following problem: file uploads OK, but problem occurs when I
try to download or view the file. After some innvestigation, I found out
that only first 2MB od data is actually downloaded (exactly 2.000.000
bytes) resulting in corrupted files. (uploaded files are OK!) I couldn't
find that limit anywhere in my system. If the original filesize is under
2M, files are downloaded and/or viewed correctly. Firefox, Opera, IE6 -
they all behave in the same way. Win98, 2000, XP - the same

If I manualy fetch the files (bypassing DOCman), downloads is OK!

What am I missing here? I'm pretty sure it's PHP related, but I'm running
out of ideas where to look. Pls. help,
//Marin


How do you download the file? Do you just go to the file directly, or do
you use something like "getfile.php?id=yourfilehere". If you use the
second method, make shure you don't try to read the file-contents into a
variable before displaying it:

$content = join( "\n", file( $fileLocation ) );

because this will cause errors with the php memory usage. Use fopen and
fread instead to read small pieces and then print them reusing the same
variable.
Or if you use an output buffer, make shure it doesn't grow to big...

If you use the first method... I have no idea.

Rutger
--
Rutger Claes rg*@rgc.tld
Replace tld with top level domain of belgium to contact me pgp:0x3B7D6BD6
Do not reply to the from address. It's read by /dev/null and sa-learn only

Jul 17 '05 #4

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

Similar topics

5
by: Brandon Walters | last post by:
I wrote a file download module for my website. The reason for the file download module is that my website downloads work on a credit based system. So I need to keep track of and limit daily...
12
by: Swede | last post by:
Hello, I am posting this rather lengthy description here in hope of getting at least some insight into a problem that is really hurting my business, since I have come to the conclusion that my...
7
by: Brian Paul | last post by:
When a user clicks on a linkbutton on a page, i would like to render a printer-friendly version of the asp.net page and download it as an html attachment to the browser. The code below works great,...
4
by: hoenes1 | last post by:
Hi, in my ASP.NET App, I have a list of files which the user can download on click (using Response.BinaryWrite()). the problem is, that once a download has started, the user can't navigate in...
1
by: Al | last post by:
Hi! I try to use custom download page (download.aspx) wich writes file (about 700Mb) to response. But I can download only one file from one IP at the same time. I think that this is IIS or...
2
by: Ken Varn | last post by:
I have an ASP.NET page that incorporates the following code on a button press. private void DownloadTag_Command(object sender, CommandEventArgs e) { FileStream fs; String Filename; Filename...
1
by: a.r.austin | last post by:
Hello, I am trying to download a few files one after another from a remote server. Problem is that I don't know how to, or if I am able at all, set a time out for download. I don't want to time...
3
by: tshad | last post by:
I have a function that downloads a file to the users computer and it works fine. The problem is that I then want the program to rename the file (file.move) to the same name plus todays date. ...
4
by: clintonG | last post by:
To all Microsoft partners and customers who have been unable to download recently or access ASP.NET documentation from the msdn2 website and for all of those customers who have been lied to and...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...

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.