V.Rashkov
V.Rashkov

Reputation: 1735

PHPExcel load file from link

Is there a way that i can load the file from url, not from local directory ? I red somewhere here, that it isn't accepting http protocol, but what do i need to change to fix that ? Or maybe use something like curl to parse the file somehow to the load event ?

Just i need some way to fix this issue.

Upvotes: 2

Views: 3331

Answers (2)

iLLin
iLLin

Reputation: 760

Use cURL or file_get_contents to download the file locally, then do what you need to do with PHPExcel

Upvotes: 1

psx
psx

Reputation: 4048

You could always do this (php5):

file_put_contents('filename.xls', ­ 
  file_get_contents('http://www.mysite.com/file.xls')
);

then continue using filename.xls in PHPExcel. At the very end you can delete the temporary filename.xls file.

Upvotes: 1

Related Questions