| .. | |||||
| Admin_model.php | |||||
| Album_model.php | |||||
| Banner_model.php | |||||
| Category_model.php | |||||
| Contact_model.php | |||||
| Gallery_model.php | |||||
| Identity_model.php | |||||
| Ion_auth_model.php | |||||
| Menu_model.php | |||||
| My_model.php | |||||
| Posting_model.php | |||||
| Submenu_model.php | |||||
| index.html |
| Server IP : 103.169.32.36 / Your IP : 216.73.217.13 Web Server : Apache System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : apache ( 48) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/dpmptsp/public_html/newsigniter/application/models/ |
Upload File : |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Gallery_model extends CI_Model {
public function uploadImage(){
$fileName = slugify($this->input->post('gallery_name', true));
$config = [
'upload_path' => './images/gallery',
'file_name' => $fileName . '-' . round(microtime(true) * 10),
'allowed_types' => 'jpg|jpeg|gif|png|JPG|PNG',
'max_size' => '3000',
'max_width' => 0,
'max_height' => 0,
'overwrite' => true,
'file_ext_tolower'=> true
];
$this->load->library('upload', $config);
if(!$this->upload->do_upload('photo')){
$data['error_string'] = 'Upload error: '.$this->upload->display_errors('','');
exit();
}
return $this->upload->data('file_name');
}
public function deleteImage($fileName){
if(file_exists("./images/gallery/$fileName")){
unlink("./images/gallery/$fileName");
}
}
}
/* End of file Gallery_model.php */
| .. | |||||
| Admin_model.php | |||||
| Album_model.php | |||||
| Banner_model.php | |||||
| Category_model.php | |||||
| Contact_model.php | |||||
| Gallery_model.php | |||||
| Identity_model.php | |||||
| Ion_auth_model.php | |||||
| Menu_model.php | |||||
| My_model.php | |||||
| Posting_model.php | |||||
| Submenu_model.php | |||||
| index.html |