Can you post code for downloading files?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vladimir777
    New Member
    • Aug 2013
    • 4

    Can you post code for downloading files?

    I wrote this code but downloaded file is wrong, Can you watch part of my code :
    Code:
    $dataT = @mysql_result($result, 0, $data['data']);
        $name = @mysql_result($result, 0, $data['name']);
        $size = @mysql_result($result, 0, $data['size']);
        $type = @mysql_result($result, 0, $data['mime']);
        header("Content-type: $type");
        header("Content-length: $size");
        header("Content-Disposition: attachment; filename=$name");
        header("Content-Description: PHP Generated Data");
        header("Content-transfer-encoding: binary");
        echo $dataT;
    Last edited by Rabbit; Aug 4 '13, 07:16 PM. Reason: Please use code tags when posting code or formatted data.
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    Can you please add why you think your code is wrong (or the error-message(s))?
    Or should we guess.... ;)

    Comment

    • Vladimir777
      New Member
      • Aug 2013
      • 4

      #3
      Thanks for your answer and excuse me! This code is working. Code of searching was not working but it is ok now

      Comment

      Working...