0

hi all
i am unable to download files from live server.
but it works fine on development server.
is there any server issue with it? do i have to unable or set any extension in phpmyadmin or php.ini?

3
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by baig772
0

First check should be whether your filenames are correct. Most issues arise when a development server runs on windows (NOT case sensitive), and the live server runs on *nix (case sensitive).

0

file names are correct

if(file_exixts($filename)){
echo "file exists";
//download
}
else{
echo "file does not exixts";
}

its showing file exists but not downloading it

0

Explain "not downloading", do you get an error ? What's happening, need more info ?

no im not getting any error. download does not start on this page after printing "File exists"

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

if (file_exists($file)) {
    echo "file exists";
    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;
}
?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.