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

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

我在將文件移動(dòng)到我想要的文件夾時(shí)遇到問題

我在將文件移動(dòng)到我想要的文件夾時(shí)遇到問題

PHP
UYOU 2021-06-15 22:01:05
我需要將我的文件移動(dòng)到我想要的位置,但我的文件沒有移動(dòng)到文件夾中,所以請(qǐng)幫助我。   Here is the code of my controller "Sms_Controller".           $pic_file1 = $this->input->post('pic_file');    $pic_file1 = str_replace( "\\", '/', $pic_file1);    $filename = basename($pic_file1);        $config['upload_path']          = BASEPATH. '../assets/uploads/';        $config['allowed_types']        = 'gif|jpg|png';        $config['max_size']             = 1000;        $this->load->library('upload', $config);        if ( ! $this->upload->do_upload('pic_file')){            $error = array('error' => $this->upload->display_errors());            $this->load->view('reg_dsa', $error);        }else{            //file is uploaded successfully            //now get the file uploaded data             $upload_data = $this->upload->data();            //get the uploaded file name        }
查看完整描述

2 回答

?
心有法竹

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

請(qǐng)?zhí)鎿Q此代碼


                $config['upload_path']          = './assets/uploads/';

                $config['allowed_types']        = 'gif|jpg|png';

                $config['max_size']             = 100;

                $config['max_width']            = 1024;

                $config['max_height']           = 768;


                $this->load->library('upload', $config);


                if ( ! $this->upload->do_upload('pic_file'))

                {

                        $error = array('error' => $this->upload->display_errors());

                        print_r($error);


                }

                else

                {

                        $data = array('upload_data' => $this->upload->data());

                        print_r($data);


                }

                die; 


查看完整回答
反對(duì) 回復(fù) 2021-06-19
?
HUX布斯

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

以下是將文件從網(wǎng)站根目錄和根目錄中的uploadFolder上傳到所需文件夾的通用代碼。


/*------------------------ File Upload --------------------------- */



        $config['upload_path'] = './uploadFolder/';

        $config['allowed_types'] = 'pdf|jpg|jpeg|png';

        $this->load->library('upload', $config);

        $filename = "";

        if (!$this->upload->do_upload('filename')) {

            //$this->session->set_flashdata('error_msg', $this->upload->display_errors());

        } else {

            $data1 = array('upload_data' => $this->upload->data());

            $filename = "" . $data1["upload_data"]["file_name"];

        }


$filename is the Filename required to store in the database


查看完整回答
反對(duì) 回復(fù) 2021-06-19
  • 2 回答
  • 0 關(guān)注
  • 183 瀏覽

添加回答

舉報(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)