0

我在使用 PHPExcel 读取文件时遇到问题。这是我得到的错误:

( ! ) Fatal error: Class 'PHPExcel_Cell' not found in /Applications/MAMP/htdocs/TestRailIntegration/Classes/PHPExcel/Reader/Excel2007.php on line 739
Call Stack
#   Time    Memory  Function    Location
1   0.0023  649920  {main}( )   ../testRailScripting.php:0
2   0.0030  755712  PHPExcel_IOFactory::load( ) ../testRailScripting.php:23
3   0.0038  797288  PHPExcel_Reader_Excel2007->load( )  ../IOFactory.php:193

这是我的代码:

<?php 
include './Classes/PHPExcel.php';

echo 'Hello world' . "\n";
$FileName = $_FILES["fileName"]["name"];

$inputFileName=$_FILES["fileName"]["tmp_name"];
echo $inputFileName;

if(file_exists("uploadedFiles/".$_FILES["fileName"]["name"])){
    echo $_FILES["fileName"]["name"]." already exists";
}
else{
    move_uploaded_file($_FILES["fileName"]["tmp_name"],"uploadedFiles/".$_FILES["fileName"]["name"]);
    echo $_FILES["fileName"]["name"]." has been moved";
}

$PHPExcelObj = PHPExcel_IOFactory::load($inputFileName);
?>
4

1 回答 1

0

我看到您将文件移动到“uploadedFiles”文件夹,所以:

$PHPExcelObj = PHPExcel_IOFactory::load("uploadedFiles/".$inputFileName);
于 2012-05-11T18:33:07.677 回答