dora1989 2014-08-26 02:16
浏览 113
已采纳

使用codeigniter到mysql的上传数据excel中无法读取文件名C:\ xampp \ tmp \ php4632.tmp

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 ?

  • 写回答

1条回答 默认 最新

  • dongtuo3370 2014-08-27 03:35
    关注

    the problem is library couldn't read excel with extension xlsx (ms.office 2007 -> ) , and then i use xls (ms.office 2003)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算