我可以毫無問題地將圖像名稱保存到數(shù)據(jù)庫(kù)中,但是當(dāng)我嘗試加密名稱時(shí),只有圖像路徑獲取加密名稱,但數(shù)據(jù)庫(kù)沒有public function fileUpload(){ $clientes = $this->pm->getAllProducts(); foreach ($clientes as $cliente) { $teste = $cliente->id; } if(!empty($_FILES['file']['name'])){ // Set preference $config['upload_path'] = "uploads/"; $config['allowed_types'] = 'jpg|jpeg|png|gif'; $config['max_size'] = '5024'; // max_size in kb $config['encrypt_name'] = TRUE; $config['file_name'] = $_FILES['file']['name']; $this->upload->initialize($config); //Load upload library $this->load->library('upload',$config); $data = array( 'pub_id' => $teste, 'url' => $_FILES['file']['name'] ); $this->pm->addProduct($data); // File upload if($this->upload->do_upload('file')){ // Get data about the file $uploadData = $this->upload->data(); } }}
如何加密圖像名稱并保存到數(shù)據(jù)庫(kù)中?
翻翻過去那場(chǎng)雪
2022-01-02 15:42:20