954,606 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Cannot download files from site - Error 403

I have recently renovated the GFWR Software site at members.shaw.ca/gfwrsoftware. In former days, it easily allowed readers to download installer files for the freeware programs I write in Visual Basic 6. Now, however, WHEN PUBLISHED, an attempt at downloading causes an error stating "The website declined to show this page", etc. However, before publishing, when testing the website in three different browsers, the downloads commence as they should, with no problem at all. I used Dreamweaver CS4 to make the site, and I have no control whatsoever over the servers.

Senefelder
Newbie Poster
17 posts since Jun 2009
Reputation Points: 10
Solved Threads: 0
 

Looks for all the world like a permissions problem. If you have no control over the servers then you probably can't change the access permissions for the directory you are storing the files in either.

If you are sure that the permissions aren't the issue, you might try not just linking directly to the file but rather using readfile() to send it.

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

<?php
$file = 'monkey.gif';

if (file_exists($file)) {
    header('Content-Description: File Transfer');
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename='.basename($file));
    header('Content-Transfer-Encoding: binary');
    header('Expires: 0');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    header('Content-Length: ' . filesize($file));
    ob_clean();
    flush();
    readfile($file);
    exit;
}
?>
dietdew12z
Junior Poster
102 posts since May 2010
Reputation Points: 18
Solved Threads: 20
 

SOLVED - I changed the files I was offering to download from .exe files to .zip files, and everything worked just fine. Thanks for trying.

Senefelder
Newbie Poster
17 posts since Jun 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: