There is no problem reading the local file. Change to read Web file
Could not open Xxx.xls for reading! File does not exist.
File_exists error. If you change to file_get_contents () the data is not properly removed. Solutions
Reply to discussion (solution)
He's using file_get_contents.
Public function read ($sFileName) { //Check If file exists and is readable if (!is_readable ($sFileName)) {
throw new Exception ("Could not open". $sFileName. "For reading! File does not exist, or it was not readable. "); Get the file data $this->data = file_get_contents ($sFileName);
Boss.
is first
if (!file_exists ($pFilename)) {
throw new Phpexcel_reader_exception ("Could not open".) $pFilename. "For reading! File does not exist. ");
}
Here's an error I added a sentence!file_exists ($pFilename) &&! file_get_contents (' xxx ')
There's no error here.
Immediately following execution
$ole = new Phpexcel_shared_oleread ();
Get Excel Data
$res = $ole->read ($pFilename);
Here is the Read method
if (!is_readable ($sFileName)) {
throw new Phpexcel_reader_exception ("Could not open".) $sFileName. "For reading! File does not exist, or it was not readable. ");
}
Here is another error. did not see $this->data = file_get_contents ($sFileName); Excuse me, where did you find this? Is the version changed?
Good, I said file_get_contents not in your second place under the error?
File_get_contents can handle binary files safely, so you can read Excel files with file_get_contents
But if it is remotely read, because of the network and the other side of the cause, the probability of failure is quite large
Or should I read it back to the local temp file?
Hey. Looks like we're going to change the code. Phpexcel can read the array processing directly. Use file_get_contents only to make a string. It's all going to be corrected in the logical process.