第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何加密圖像名稱并保存到數(shù)據(jù)庫(kù)中?

如何加密圖像名稱并保存到數(shù)據(jù)庫(kù)中?

PHP
翻翻過去那場(chǎng)雪 2022-01-02 15:42:20
我可以毫無問題地將圖像名稱保存到數(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();        }    }}
查看完整描述

1 回答

?
白板的微信

TA貢獻(xiàn)1883條經(jīng)驗(yàn) 獲得超3個(gè)贊

您可以使用配置加密文件名

$config['encrypt_name'] = TRUE;

或者

$file= uniqid().time().$_FILES["file"]['name'];
$config['file_name'] = $file;



查看完整回答
反對(duì) 回復(fù) 2022-01-02
  • 1 回答
  • 0 關(guān)注
  • 181 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)