source: pro-violet-viettel/www/deploy/20150304/application/modules/ajax/controllers/download.php @ 837

Last change on this file since 837 was 831, checked in by quyenla, 10 years ago
  • Property svn:executable set to *
File size: 1.1 KB
Line 
1<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
3
4class Download extends MX_Controller
5{
6
7        public function __construct() {
8                parent::__construct();
9                $user = $this->session->userdata ( 'userInfo' );
10                $this->vservices->setApiUrl($this->config->item('api_url'));
11                $this->vservices->setConnection($this->curl);
12                $this->vservices->setUserId($user['us_id']);
13        }
14       
15        public function getFile () {
16                $file = $this->config->item('api_url').'uploads/space/3/3854/1.JPG';
17                header('Content-Description: File Transfer');
18                header('Content-Type: application/octet-stream');
19                header('Content-Disposition: attachment; filename='.basename($file));
20                header('Expires: 0');
21                header('Cache-Control: must-revalidate');
22                header('Pragma: public');
23                header('Content-Length: ' . filesize($file));
24                readfile($file);
25                exit;
26           
27        }
28       
29
30}
31
32/* End of file privatecontent.php */
33/* Location: ./application/modules/ajax/controllers/privatecontent.php */
Note: See TracBrowser for help on using the repository browser.