本文整理汇总了PHP中MY_Controller::generate_filestamp方法的典型用法代码示例。如果您正苦于以下问题:PHP MY_Controller::generate_filestamp方法的具体用法?PHP MY_Controller::generate_filestamp怎么用?PHP MY_Controller::generate_filestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MY_Controller
的用法示例。
在下文中一共展示了MY_Controller::generate_filestamp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upload_update
public function upload_update()
{
$upload_type = $this->input->post('upload_type');
$upload_path = $upload_type == '1' ? 'system_updates/' : 'system_setups/';
$file_path = $upload_path;
// $file_path = 'system_updates/';
$zip_name = MY_Controller::generate_filestamp();
//Generate Zip Name from My_Controller for Standardization
// $config['upload_path'] = 'system_updates/';
$config['upload_path'] = $upload_path;
$config['allowed_types'] = '*';
//
$config['file_name'] = $zip_name;
$this->load->library('upload');
//Upload
$this->upload->initialize($config);
if ($this->upload->do_upload()) {
$this->session->set_flashdata('system_success_message', 'File Upload Successful');
} else {
echo "<pre>";
print_r($this->upload->display_errors());
echo "</pre>";
exit;
$this->session->set_flashdata('error', 'File Upload Not Successful');
}
$description = $this->input->post('description');
$user_id = $this->session->userdata('user_id');
$filename = $zip_name . '.zip';
$file_data = array('update_name' => $filename, 'description' => $description, 'user_id' => $user_id, 'status' => 0, 'type' => $upload_type);
// $file_data_old = array('update_name'=>$filename);
// $this -> db -> insert('system_uploads', $file_data);
$this->db->insert('update_log', $file_data);
redirect('admin/offline');
}