Zubrag.com :: Forum

zubrag.com => Smart File Download => Topic started by: jkiss on April 20, 2008, 11:16:56 AM



Title: Downloaded Files are corrupt - Common Problem
Post by: jkiss on April 20, 2008, 11:16:56 AM
I've  read a few comments where after using the script File Download, the file is corrupt. I had the same issue but found the problem and would like to share my findings to help you.

I'm running Fedora Core 4, PHP Version 5.04 and IE 6.0.2900

After downloading any file type, txt or binary they were corrupted or not the same as the original. What I have found is there is at least one extra line added to the top of every downloaded file.

A little more digging and found that the problem is not with the download.php code but somewhere else and the problem was with what I had done.

I added a "include_once" at the top of the file to add in my own defines. The included file is a pure PHP file, meaning it starts with at <?php at the top and the last line is a ?>.

However the problem was with what was past the last ?>, line feeds. By including this file those extra line feeds were added to the top of my downloaded file.

The Fix : After the ?> in my included file I deleted all the blank lines. Then all was well.

Just want to add that File Download version 1.3 works very well. And if I wouldn't have changed anything with it all would have been well.

Cheers
John




Title: Re: Downloaded Files are corrupt - Common Problem
Post by: disconap on July 10, 2009, 10:28:19 PM
JKiss, thank you SO MUCH.  This was driving me insane; I had a 30% success rate on various machines (which I still don't understand, since shouldn't the files either have worked or been corrupt?), then read this and deleted some blank space and voila!  All working.  If you're ever in Portland, I owe you a beer.  :)


Title: Re: Downloaded Files are corrupt - Common Problem
Post by: ricday on August 05, 2009, 11:51:46 PM
I wonder how similar this is to the problem I am seeing: downloaded .zip files are "wrapped" in a folder with the same name as the .zip file (e.g. ABC.ZIP is contained in a folder called ABC.ZIP after download ... double-clicking the downloaded folder in Windoze generates a "corrupt file" warning. but the file can be opened with 7-zip or WinRar). This corruption only happens in IE8 ... the files still download correctly in current versions of FireFox, Opera, Chrome, and Safari.


Title: Re: Downloaded Files are corrupt - Common Problem
Post by: PSPLover on March 20, 2010, 03:51:34 AM
Is it possible to use winrar on Linux Server?


Title: Re: Downloaded Files are corrupt - Common Problem
Post by: ridanoor08 on June 20, 2012, 11:16:15 AM
I had been suffering alot due to this problem. It resolved in few seconds due to your suggestion... Thanx............ ALot