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.

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

$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));

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.