문제

I am using PHPExcel plugin for reading excel and storing values in database.Its really cool and works very fine.But I have an issue when I am uploading an excel sheet from different location on my machine.
I guess it is bcoz,the PHPExcel.php has a constant defined

if (!defined('PHPEXCEL_ROOT')) {
   define('PHPEXCEL_ROOT', dirname(__FILE__) . '/');
   require(PHPEXCEL_ROOT .'PHPExcel/Autoloader.php');
} 

I would like to know how can I upload and read file from any location?Also,I am not saving my file after uploading,but just reading and saving records to DB, as the purpose is to just enter the records into a database.How can I fix it? The documentation is really good and extensive but I am a bit short of time to explore it and also a newbie to Obj Oriented PHP
Thanks for your time.


PS : I am not storing the file on the server,just reading and fetching the data from it.

도움이 되었습니까?

해결책

@Mark Baker
Your comments helped me a lot and I fixed the issue.I was trying actually to reduce the load by not uploading the file.Instead just reading it and saving it.But it is not possible as we have to have the file physically located on the serve at the time of operation. I have changed my approach and now upload the file,read it and then unlink the file from the server after the operations are over.

Thank you for the help and I appreciate your efforts in answering folks over PHPExcel issues.It is indeed a great tool to work on and looking forward to explore it more.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top