Monday 3 September 2018
Subscribe to:
Post Comments (Atom)
header()
function, the problem raises when I host my website on Bluehost, it works fine on localhost. here is my function to access the image.function download($name = '', $tiny = '0') {
if ($name != '') {
$file = $this->mdl->get_file($name);
if($file){
$mime = mime_content_type('./'.$file->path.$file->name);
header('Content-Type: '.$mime);
echo file_get_contents('./'.$file->path.$file->name);
}
}
}
function get_file($name=''){
if($name!=''){
return $this->db->select('*')
->from('docs')
->where('name',$name)
->get()
->row();
}
return false;
}
Hello Friends! I am Ramana a part time blogger from Hyderabad.
0 comments:
Post a Comment