PHP下载脚本将下载次数增加两倍

I am doing a project where user can download the files by clicking download button. Upon clicking the download link, the request is redirected to the download.php file where actual download code resides. After downloading, the number of downloads is increases by 1 in the database. The PHP code (written in codeigniter) is as follows

public function index($filename)
    {
        $item = array_shift($this->music_m->get_by(array('upload_path'=>$filename)));
        if(count($item)){
            if (file_exists("uploads/".$filename)) {
                $item->noOfDownloads = $item->noOfDownloads + 1;
                $this->music_m->save($item, $item->id);
                $data = file_get_contents("uploads/".$filename); // Read the file's contents
                $name = $filename;
                force_download($name, $data);
            }else{
                echo "404 File Not Found";
                exit;
            }
        }else{
            echo "404 File Not Found!";
        }
    }

But my problem is, the number of download increases by 2 or 3 or even 6 (with IDM) instead of 1. In Linux with Firefox browser, it works fine. But in windows, in Google chrome, it increases by 2. The condition gets worst when IDM downloads the file, it increases the number of downloads by 6. I don't know where may be the error. Whether the script itself is called multiple times or what else?