upload file dont work properly on my server
function upload_cover(){
$config_cover['upload_path'] = 'img/blog/';
$config_cover['allowed_types'] = 'gif|jpg|png|tif';
get_instance()->load->library('upload', $config_cover);
if($this->upload->do_upload('myFile') )
{
$upload_data = $this->upload->data();
$path = 'img/blog/'.$upload_data['file_name'];
return $path;
}
}
function upload_file(){
$config_file['upload_path'] = 'img/blog/';
$config_file['allowed_types'] = 'doc|docx|pdf|txt|xls|xlsx|ppt|pptx';
$this->upload->initialize($config_file);
if ($_FILES['myDoc']) {
if($this->upload->do_upload('myDoc'))
{
$upload_data = $this->upload->data();
$path = 'document/blog/'.$upload_data['file_name'];
return $path;
}
}
}
these code are work properly on my computer but when i deploy it on my
server it's work only "upload_cover" but upload_file is not working im
have no idea.... someone please help,thanks a lot...
No comments:
Post a Comment