url to Download

Topics: Developer Forum, Project Management Forum, User Forum
Mar 5, 2013 at 7:54 AM
I have code:
$objPHPExcel = PHPExcel_IOFactory::load("test.xls");
but that local.
if I start download to url ( http://test/rg/test.xls )
show that:
Fatal error: Uncaught exception 'Exception' with message 'Could not open http://test/rg/test.xlsfor reading! File does not exist.' in C:\xampp\htdocs\rg\PHPExcel\Reader\Excel5.php:519 Stack trace: #0 C:\xampp\htdocs\rg\PHPExcel\IOFactory.php(268): PHPExcel_Reader_Excel5->canRead('http://localhos...') #1 C:\xampp\htdocs\rg\PHPExcel\IOFactory.php(205): PHPExcel_IOFactory::createReaderForFile('http://localhos...') #2 C:\xampp\htdocs\rg\index.php(139): PHPExcel_IOFactory::identify('http://localhos...') #3 C:\xampp\htdocs\rg\index.php(76): upda('http://localhos...') #4 C:\xampp\htdocs\rg\index.php(203): main() #5 {main} thrown in C:\xampp\htdocs\rg\PHPExcel\Reader\Excel5.php on line 519
Coordinator
Mar 5, 2013 at 8:55 AM
PHPExcel will only read files on the server, not remote files. This is because it needs to be able to stat() files, and that function isn't supported by PHP's filestream wrappers for remote files. Copy the file to your server, and then you can access it.