• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Download Status Check

#1
[eluser]moin cse[/eluser]
I am using codeigniter downlaod library to download content from my application, But need to track every successful download that is I need to update database, I can call a db function before downlaod script execute, but if download is unsuccessful due to power failure or internet connection interruption then I need not to update db or something like that.

Code:
$this->load->helper('download');
    
$data['order_id'] = $order_id;
$data['app_code'] = $app_code;
$app_download_info = $this->apiinfo_model->insert_app_download_info($data);
$file_path = "http://localhost/app/store/132.txt";
$data = file_get_contents($file_path);
$name = 'test_name.txt';  
force_download($name, $data);

So how can I achieve this,
any idea will be highly appreciated.

Thanks in Advance
-Moin

#2
[eluser]CroNiX[/eluser]
I don't believe there is a way to detect a successful download of a file since that's happening in your browser and the browser doesn't sent anything back by default. Probably the only way is to use Flash or something. You could have a button or something that the user clicks when they have received the file to indicate it was successful, but that relies on their interaction. When you run the helper, you could insert a 0 in the DB to indicate unsuccessful (since you don't know) and if they click the link it gets updated to 1.

#3
[eluser]moin cse[/eluser]
Can I make a web based ftp application here for getting download status information in details?

any suggestion?

Thanks


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.