tente baixar o arquivo e obter arquivo inválido em resposta no núcleo php

Eu faço o download de um arquivo, mas ele dá um arquivo inválido em troca.

Aqui é meudownload_content.php

<?php    
  $filename = $_GET["filename"]; 


    $buffer = file_get_contents($filename);

    /* Force download dialog... */
    header("Content-Type: application/force-download");
    header("Content-Type: application/octet-stream");
    header("Content-Type: application/download");

    /* Don't allow caching... */
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

    /* Set data type, size and filename */
    header("Content-Type: application/octet-stream");
    header("Content-Transfer-Encoding: binary");
    header("Content-Length: " . strlen($buffer));
    header("Content-Disposition: attachment; filename=$filename");

    /* Send our file... */
   echo $buffer; 
?> 

link do arquivo de download:

<a href="download_content.php?filename=/gallery/downloads/poster/large/'.$r['file'].'"> Download</a>

$r['file'] contém o nome do arquivo a ser baixado.

O caminho completo da pasta que contém o arquivo é:

localhost/ja/gallery/downloads/poster/large/'.$r['file'].'

ja é a pasta raiz emhtdocs.

Eu não sei qual é o problema real, alguém pode me ajudar por favor?

questionAnswers(3)

yourAnswerToTheQuestion