Help needed with script please!

Discussion in 'PHP' started by web-master, Apr 7, 2008.

  1. #1
    Hi,

    I downloaded the script from http://www.gerd-tentler.de/tools/filemanager/ and have set it up.

    However I can't get one of the features to work. When trying to download a file again I get errors. Here is a link to one of the downloads so you can see the errors for yourself. http://adschemes.com/ftp/66666666666666666666666666778/get_file.php?file=eXtplorer_2.0.0_RC2.zip

    It should download the file like on the scripts website but mine gets errors.

    Can anyone see why?

    Main part of script on my server is http://adschemes.com/ftp/66666666666666666666666666778/filemanager.php

    Cheers

    Web-Master
     
    web-master, Apr 7, 2008 IP
  2. powerspike

    powerspike Peon

    Messages:
    312
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    ok first things first

    Warning: Cannot modify header information - headers already sent by (output started at /home/adscheme/public_html/ftp/66666666666666666666666666778/get_file.php:1) in /home/adscheme/public_html/ftp/66666666666666666666666666778/get_file.php on line 35
    you either need to turn off output buffering, or find out where the data is coming from first (ie a blank line at the top of one of your scripts)

    second

    Warning: readfile(eXtplorer_2.0.0_RC2.zip) [function.readfile]: failed to open stream: No such file or directory in /home/adscheme/public_html/ftp/66666666666666666666666666778/get_file.php on line 36

    that is saying the file you are trying to download doesn't exsist, you need to make sure the webserver has write permission to the downloads/uploads directory, in an ftp client, there should be an option to "chmod" the files - make it 777 and it should fix that hopefully.
     
    powerspike, Apr 7, 2008 IP
  3. web-master

    web-master Peon

    Messages:
    838
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    cheers,
    thanks for the help,

    will do that

    web-master
     
    web-master, Apr 7, 2008 IP
  4. web-master

    web-master Peon

    Messages:
    838
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
  5. PowerExtreme

    PowerExtreme Banned

    Messages:
    2,118
    Likes Received:
    75
    Best Answers:
    0
    Trophy Points:
    0
    #5
    in get_file.php

    after

    <?
    
    Code (markup):
    add

    ob_start();
    
    Code (markup):
     
    PowerExtreme, Apr 7, 2008 IP
  6. web-master

    web-master Peon

    Messages:
    838
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #6
    done that and the errors are still there and exactly the same :(
     
    web-master, Apr 7, 2008 IP
  7. PowerExtreme

    PowerExtreme Banned

    Messages:
    2,118
    Likes Received:
    75
    Best Answers:
    0
    Trophy Points:
    0
    #7
    can u post the get_file.php source code here
     
    PowerExtreme, Apr 7, 2008 IP
  8. web-master

    web-master Peon

    Messages:
    838
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #8
    sure its

    <?
    /*********************************************************************************************************
    This code is part of the FileManager software (www.gerd-tentler.de/tools/filemanager), copyright by
    Gerd Tentler. Obtain permission before selling this code or hosting it on a commercial website or
    redistributing it over the Internet or in any other medium. In all cases copyright must remain intact.
    *********************************************************************************************************/

    error_reporting(E_WARNING);

    //========================================================================================================
    // Start session and get session variables; needs PHP 4 or higher
    //========================================================================================================

    if(function_exists('session_start')) session_start();

    $fmCurDir = $_SESSION['fmCurDir'];

    //========================================================================================================
    // Set variables, if they are not registered globally; needs PHP 4.1.0 or higher
    //========================================================================================================

    if(isset($_REQUEST['file'])) $file = $_REQUEST['file'];

    if(isset($_SERVER['HTTP_HOST'])) $HTTP_HOST = $_SERVER['HTTP_HOST'];

    //========================================================================================================
    // Includes
    //========================================================================================================

    if($HTTP_HOST == 'localhost' || $HTTP_HOST == '127.0.0.1' || ereg('^192\.168\.0\.[0-9]+$', $HTTP_HOST)) {
    include('config_local.inc.php');
    }
    else {
    include('config_main.inc.php');
    }

    if(!isset($language)) $language = 'en';
    include("languages/lang_$language.inc");
    include('fmlib.inc.php');

    //========================================================================================================
    // Main
    //========================================================================================================

    // make sure that filename contains no path
    $file = basename($file);

    $filename = $file;

    if($ftp_server) {
    if($ftp = fm_connect()) {
    $file = fm_get("$fmCurDir/$file");
    @ftp_quit($ftp);
    }
    }
    else $file = "$fmCurDir/$file";

    if(file_exists($file)) {
    if($replSpacesDownload) $filename = str_replace(' ', '_', $filename);
    if($lowerCaseDownload) $filename = strtolower($filename);

    header('Content-Type: application/octetstream');
    header('Content-Disposition: attachment; filename="' . $filename . '"');
    header('Pragma: no-cache');
    header('Expires: 0');
    readfile($file);
    }
    else {
    ?>
    <html>
    <head>
    <link rel="stylesheet" href="filemanager.css" type="text/css">
    </head>
    <body>
    <?
    fm_view_error($msg['errOpen'] . ": $filename");
    ?>
    </body>
    </html>
    <?
    }
    ?>
     
    web-master, Apr 7, 2008 IP
  9. Free Directory

    Free Directory Peon

    Messages:
    89
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #9
    just a question: put this print_r(headers_list());die();on line 2, and show us the output.
    <?

    /****

    Could come from your PHP. Can you tell us what php version you have, and ... if you have access to php.ini?
     
    Free Directory, Apr 8, 2008 IP