Page 1 of 1
Help! PHP download script downloads corrupted file.
Posted: Wed May 30, 2007 2:41 am
by eddieq
Hi.
I'm not a PHP programmer. So recently I bought a php script on the net for my coming estore.
After installation, it has some wierd problems. I tried to contact him but he seems to be ignoring me.
I hope someone here can help me for I'm really in a fix right now.
The script is called Download Manager. It is the backend digital delivery system.
The problem is that somes files downloaded using the script downloads fine while others just pause a few seconds and than show 209 bytes and if you downloads, it downloads a corrupted file. below is an example:
http://www.motioncow.com/downloadman
Login
sales@phpcart.net
Password 12345678
Your package shows 2 files:
1.Grid_Lines.mov ( 87.5M ) is downloadable as normal.
2.Luminous.mov ( 46M ) when clicked pauses a few seconds. Then shows only 209 bytes, which is wrong. Thus downloads a corrupted file.
Using FTP downloads the files fine. I have 18 files and 10 of them has this problem. All problematic files shows 209 bytes. re-uploading or renaming the files doesn't help.
I'll be most appreciative if someone here can tell me if this is a PHP downloadfile limitation, server problem, or script problem and how I can solve this.
Thanks,
Eddie
Posted: Wed May 30, 2007 2:46 am
by volka
If you open this 209 bytes large file in a text editor you will see
<br />
<b>Fatal error</b>: Allowed memory size of 41943040 bytes exhausted (tried to allocate 47544320 bytes) in <b>/home/eddieq/public_html/motioncow/downloadman/downloadfile.php</b> on line <b>88</b><br />
For some reason the script tries to load
the whole file into memory and the memory usage is limted to 40MB by the server's configuration.
Posted: Thu May 31, 2007 2:38 am
by eddieq
volka wrote:If you open this 209 bytes large file in a text editor you will see
<br />
<b>Fatal error</b>: Allowed memory size of 41943040 bytes exhausted (tried to allocate 47544320 bytes) in <b>/home/eddieq/public_html/motioncow/downloadman/downloadfile.php</b> on line <b>88</b><br />
For some reason the script tries to load
the whole file into memory and the memory usage is limted to 40MB by the server's configuration.
First I'll like to thank you for this lead.
For 3 weeks I've been trying to find out the cause of the problem without a clue.
So do you think this is the fault of the PHP script or web server of my hosting company?
You see, I needed a script that does automatic digital downloads whenever my customers paid via Paypal.
My products are huge, the largest being 120 MB. I can't tell my web host to allocate the memory size that my huge files can fit in right?
Wouldn't it be more reasonable that the code is written to execute the download without being so resource hungry?
Does a PHP script have to load everything into memory just to do the download?
Should I be pointing my finger to my Web Hosting Co or the author of the script?
EddieQ
Posted: Thu May 31, 2007 3:13 am
by volka
eddieq wrote:Does a PHP script have to load everything into memory just to do the download?
No.
eddieq wrote:My products are huge, the largest being 120 MB. I can't tell my web host to allocate the memory size that my huge files can fit in right?
They probably won't like that, no. On the other hand the script is able to server a file that is almost double the size without problems. And if not for other reasons that's why I'd say
eddieq wrote:Should I be pointing my finger to my Web Hosting Co or the author of the script?
the author.
Posted: Thu May 31, 2007 11:31 pm
by eddieq
That means I have to drop the current author and look for another script.
Can you pls point me in the right direction what to look out for to avoid this download size problem?
I mean, is there a php command/technique that is resource hungry that I should instruct the author to avoid?
Or should I avoid php altogether?
If I to go out to purchase another script, what questions should I pose the the authur to know if it'll give me the same problem?
I know for sure an ftp program can download any size file without being resource hungry. Why can't a script be written that way and yet retaining all the protection feature like password/expiry/file location secret links?
Lastly, do you know site that I can hire someone to write this script and what 's the average cost?
Thanks,
EddieQ
Posted: Fri Jun 01, 2007 6:49 am
by superdezign
eddieq wrote:I know for sure an ftp program can download any size file without being resource hungry. Why can't a script be written that way and yet retaining all the protection feature like password/expiry/file location secret links?
Servers tend to be programmed and modified to disallow any one user to eat up too many resources, and that's done with limitations. Going beyond those limitations is risky, but possible. I tend to avoid large files anyway.. uses up your space and your bandwidth for too little.
Then again, I always tend to think in terms of money, sooo...

Posted: Sat Jun 02, 2007 9:19 am
by eddieq
[quote="eddieq"]That means I have to drop the current author and look for another script.
Can you pls point me in the right direction what to look out for to avoid this download size problem?
I mean, is there a php command/technique that is resource hungry that I should instruct the author to avoid?
Or should I avoid php altogether?
If I to go out to purchase another script, what questions should I pose the the authur to know if it'll give me the same problem?
I know for sure an ftp program can download any size file without being resource hungry. Why can't a script be written that way and yet retaining all the protection feature like password/expiry/file location secret links?
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Anyone has any ideas? Will really appreciate as I'm not a php programmer. I considered splitting the large size with Stuffit but it will mean hassle for my customers to join it back after they download the expander program. That will only be left to last resort.
Thanks,
EddieQ