IIS错误加载文件中的phpexcel错误:无法打开临时/用于阅读!文件不存在



我有错误。在互联网上阅读我可以的所有内容。仍然没有运气..我希望有人可以在Windows IIS中的phpexcel回答此问题这是我的代码与XAMPP效果很好(但在IIS中不能):

  <?php  set_include_path(get_include_path() . PATH_SEPARATOR . 'Classes/');
    /** PHPExcel_IOFactory */
    include 'PHPExcel/IOFactory.php';
                move_uploaded_file($_FILES["file"]["tmp_name"],
                "temp/" . $_FILES["file"]["name"]) ;
    $inputFileName = "temp/".$_FILES["file"]["name"];  // File to read
    //echo 'Loading file ',pathinfo($inputFileName,PATHINFO_BASENAME),' using IOFactory to identify the format<br />';
    try {
        $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
    } catch(Exception $e) {
        die('Error loading file "'.pathinfo($inputFileName,PATHINFO_BASENAME).'": '.$e->getMessage());
    }
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
print_r($sheetData);
$bilang=0;
$pumasok=0;
$hindi=0;
$iHerd= $_SESSION['urHerd'];
$iAnit = 1;
foreach($sheetData as $rec)
{   
$bilang++;
//////etc etc
}
?>

我遇到了这个错误:错误加载文件" Animal.xlsx":无法打开temp/andial.xlsx进行阅读!文件不存在。

thanx提前

我通过更改文件夹的读取权限解决了问题非常适合您查看

尝试:

use PHPExcel_Settings;
PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);

行代码要求" phpexcel.php"

最新更新