Problem In proper Mime type,header

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Problem In proper Mime type,header

    Any1 Pls help Me whats Error in
    dis
    code
    PHP Code:
    <?
    include 'inc/connect.php';
    $i = secure('c');
    $game = mysql_query("SELECT * FROM game WHERE id='$i'") or die("Error : File Not Found");
    $My = mysql_fetch_array($game);
    $name = $My['name'];
    $link = $My['link'];
    $Load = $My['download'];
    $size = $My['size'];
    $nLoad = $Load + 1;
    //Saving It Too Database ... $upx = mysql_query("UPDATE game SET download='$nLoad' WHERE id='$i'") or die("Error Error In Processing");

    if(eregi("\.sis",$link)){
    $mime = "application/vnd.symbian.install";
    $xtn = ".sis";
    }
    elseif(eregi("\.sisx",$link)){
    $mime = "x-epoc/x-sisx-app";
    $xtn = ".sisx"; 
    }
    elseif(eregi("\.jar",$link))
    {
    $mime = "application/java-archive";
    $xtn = ".jar";
    }
    header("Content-type: $mime");
    header("Content-Length: $size");
    header("Content-Disposition: attachment; filename=$name.$xtn");
    readfile("$link");
    ?>
    Problem is when I Open Dat Link

    its Showing File Name Pirates4.

    And Filetype Unknow

    I set Mime type But No Effect
    Last edited by shushant; 06.12.11, 15:20. Reason: For Old Code
Working...
X