简体   繁体   中英

The filename C:\xampp\tmp\php4632.tmp is not readable in upload data excel with codeigniter to mysql

before it, i use other function to upload excel data with codeigniter to mysql, but show error the file path is not readable, and then i use this code to upload excel data

//setting excel reader   
error_reporting(E_ALL ^ E_NOTICE);
error_reporting(0);
require_once 'include/excel_reader.php';
    $get_periode    = $this->input->post("periode");
    $data = new Spreadsheet_Excel_Reader($_FILES['userfile']['tmp_name']);
    $count = 0;
    //read excel
    foreach($data->dump(false,false,false,false) as $row){
    $value  = $this->ruas_jalan_model->get_by(array("NAMA_KOTA"=>$row["NAMA_KOTA"]),FALSE,FALSE,TRUE);
                    $data2  = array(
                        "ID_PERIODE"        => $get_periode,
                        "NAMA_KOTA"         => $value["NAMA_KOTA"],
                        "NO_RUAS1"          => $value["NO_RUAS1"],
                        "NO_RUAS2"          => $value["NO_RUAS2"],
                        "NO_RUAS3"          => $value["NO_RUAS3"],
                        "NAMA_RUAS"         => $value["NAMA_RUAS"],
                        "PANJANG"           => $value["PANJANG"],
                        "HOTMIX_BAIK"       => $value["HOTMIX_BAIK"],
                        "HOTMIX_SEDANG"     => $value["HOTMIX_SEDANG"],
                        "HOTMIX_RR"         => $value["HOTMIX_RR"],
                        "HOTMIX_RB"         => $value["HOTMIX_RB"],
                        "LAPEN_BAIK"        => $value["LAPEN_BAIK"],
                        "LAPEN_SEDANG"      => $value["LAPEN_SEDANG"],
                        "LAPEN_RR"          => $value["LAPEN_RR"],
                        "LAPEN_RB"          => $value["LAPEN_RB"],
                        "LPC"               => $value["LPC"],
                        "TANAH"             => $value["TANAH"],
                        "HUTAN"             => $value["HUTAN"],
                        "LANG"              => $value["LATITUDE"],
                        "LOT"               => $value["LOTITUDE"]
                    );
                    $this->ruas_jalan_model->save($data2);
                    $count++;                                               
            }

but i still get error not readable, and i don't know why, this is the error code

The filename C:\xampp\tmp\php4632.tmp is not readable

whats wrong ?

问题是库无法使用扩展名xlsx(ms.office 2007->)读取excel,然后我使用xls(ms.office 2003)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM