简体   繁体   中英

Problems reading excel file with PHPExcel

I am having trouble reading a file with PHPExcel. Here is the error I'm getting:

( ! ) 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

And here is my code:

<?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);
?>

我看到您将文件移到“ uploadedFiles”文件夹中,因此:

$PHPExcelObj = PHPExcel_IOFactory::load("uploadedFiles/".$inputFileName);

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