i am having problems with my ftp/php cross domain requests. With my browser i can access the contents, by passing an argument like this: <http://xxx.org/models/get.php?file=default_app/y_car_new/stock.jpg> . But with JavaScript the same link gives me Origin `http://localhost:8000 is not allowed by Access-Control-Allow-Origin`
i already tried 

> 
> header("Access-Control-Allow-Origin: \*")
> 
> 
> 

with no luck on the following script. I have a get.php file in my ftp access only server with the following code:

```
<?

if(isset($_GET["file"])) {
    $filepath = "/.../models/".$_GET["file"];
    //echo "path: " , $filepath;
    $filetype = pathinfo($filepath);
    //echo $filetype['extension'], "\n";
    header('Access-Control-Allow-Origin: *');
    header('Content-Type: '.$filetype['extension']);
    // //header('Content-Type: application/octet-stream');
    header('Content-Length: ' . filesize($filepath));
    ob_clean();

    readfile($filepath);
}//if

else {
   echo '<img src="http://stupidbadmemes.files.wordpress.com/2013/02/no-you-may-not.jpg"></img>';
}

?>

```

what am i doing wrong in this script?