Commit 79fdedbe authored by 王源's avatar 王源 🎧

修改获取文件类型bug

parent a33b9e4e
......@@ -53,9 +53,9 @@ class ExcelImporter
public function __construct($file, $sheetIndex = 0)
{
$this->config = container(ConfigInterface::class);
$this->fileType = ucfirst($file->getExtension());
$this->rootPath = $this->config->get('server.settings.document_root', BASE_PATH . '/public');
$path = UploadManager::uploadExcelGetRealPath($file);
$this->fileType = ucfirst(strtolower(pathinfo($file, PATHINFO_EXTENSION)));
$this->reader = IOFactory::createReaderForFile($path)->load($path);
$this->filePath = $path;
$this->sheet = $this->reader->getSheet($sheetIndex);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment