1

My host is running Apache 2.0.63 on Redhat Enterprise 4. I'm trying to have two versions of a movie available for download, HD and SD, and both are in DivX .avi format. I uploaded the SD file fine which was 700mb, and after a couple days of uploading finally have the 3gb HD file up there too. The 700mb file I can access and download no problem, but the 3gb one is doing some very strange things:

-I set the CHMOD to 777 but I still get a 403 Forbidden when I try to download it

-I SSH'd into the server and listed the files in the directory and the 3gb file has an asterisk next to its name (indicating it's an executable) while the 700mb file doesn't.

-Tried renaming the file and changing the extension but nothing seems to work.

Does anyone have any ideas? Should I re-upload the file? Thanks!

1
  • Updating Apache got rid of the 403 and allowed me to download the file directly, but when I use dir to list the files in the directory the large file still has the asterisk next to it indicating it's an executable (which it isn't). Also, in PHP the file_exists() function recognizes the file but is_file and filesize() do not. This same script works fine for the 722mb file.
    – user50215
    Commented Sep 23, 2010 at 21:59

1 Answer 1

3

Update your Apache to 2.2, earlier versions have reported problems with offering large files for download.

If that doesn't work, try downloading the file using wget like so:

wget http://yourdomain.com/largefile.avi

and see if that works.

UPDATE:

From http://php.net/manual/en/function.filesize.php:

Note: Because PHP's integer type is signed and many platforms use 32bit integers, filesize() may return unexpected results for files which are larger than 2GB. For files between 2GB and 4GB in size this can usually be overcome by using sprintf("%u", filesize($file)).

It looks like support for large files will be included in PHP 6.x which will be released into the public soon.

3
  • Thanks! I'm always reluctant to start messing with major server config stuff like that, but WebHost Manager made it pretty simple and easy to update automatically and that fixed it.
    – user50215
    Commented Sep 23, 2010 at 21:17
  • Alright, I spoke too soon. Now I can directly download the file but the PHP download script I'm using to mask the file source is still having the same issue. When I try to run the filesize() or is_file() functions on the file I get errors like it doesn't recognize it. PHP 5.3.3 is installed.
    – user50215
    Commented Sep 23, 2010 at 21:39
  • @user50215 Check my updated answer.
    – Pylsa
    Commented Sep 24, 2010 at 8:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .