• <small id='nG1e9'></small><noframes id='nG1e9'>

        <bdo id='nG1e9'></bdo><ul id='nG1e9'></ul>
    1. <i id='nG1e9'><tr id='nG1e9'><dt id='nG1e9'><q id='nG1e9'><span id='nG1e9'><b id='nG1e9'><form id='nG1e9'><ins id='nG1e9'></ins><ul id='nG1e9'></ul><sub id='nG1e9'></sub></form><legend id='nG1e9'></legend><bdo id='nG1e9'><pre id='nG1e9'><center id='nG1e9'></center></pre></bdo></b><th id='nG1e9'></th></span></q></dt></tr></i><div id='nG1e9'><tfoot id='nG1e9'></tfoot><dl id='nG1e9'><fieldset id='nG1e9'></fieldset></dl></div>
    2. <legend id='nG1e9'><style id='nG1e9'><dir id='nG1e9'><q id='nG1e9'></q></dir></style></legend>

      <tfoot id='nG1e9'></tfoot>

        文件名 feed1.xls 在 php 中不可读

        The filename feed1.xls is not readable in php(文件名 feed1.xls 在 php 中不可读)

        <small id='nScqq'></small><noframes id='nScqq'>

          <legend id='nScqq'><style id='nScqq'><dir id='nScqq'><q id='nScqq'></q></dir></style></legend><tfoot id='nScqq'></tfoot>
            <tbody id='nScqq'></tbody>

            <i id='nScqq'><tr id='nScqq'><dt id='nScqq'><q id='nScqq'><span id='nScqq'><b id='nScqq'><form id='nScqq'><ins id='nScqq'></ins><ul id='nScqq'></ul><sub id='nScqq'></sub></form><legend id='nScqq'></legend><bdo id='nScqq'><pre id='nScqq'><center id='nScqq'></center></pre></bdo></b><th id='nScqq'></th></span></q></dt></tr></i><div id='nScqq'><tfoot id='nScqq'></tfoot><dl id='nScqq'><fieldset id='nScqq'></fieldset></dl></div>

                • <bdo id='nScqq'></bdo><ul id='nScqq'></ul>

                • 本文介绍了文件名 feed1.xls 在 php 中不可读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想使用 zend 框架解析一个 excel 文件.我去了 Zend Developer Zone 并找到了解决方案下载 phpexcelreader.我下载了代码,在 localhost 设置了一个项目并运行代码.当我尝试读取 .xlsx 文件时,它会生成错误

                  文件名 feed1.xlsx 不可读

                  我以 .xls 格式保存文件并运行代码成功解析文件.现在我想在我用 Zend framework 开发的项目中实现这个.我创建了一个模型,并在我的项目中 require_once 像这样在我的项目顶部编辑了 excelreader.

                   require_once 'Excelreader/Excel/reader.php';类 ExcelreaderModel 扩展 Zend_Db_Table{函数读取文件(){$data = new Spreadsheet_Excel_Reader();//设置输出编码.$data->setOutputEncoding('CP1251');//$data->read('Excelreader/Excel/feed1.xls');$data->read('feed1.xls');echo '

                  ';打印_r($数据);echo '</pre>';}}

                  我在我的控制器中调用了这个模型函数.但它产生了与我使用 .xlsx 文件在 localhost 上发现的相同的错误.但我正在阅读 .xls 文件,该文件由在 localhost 上的简单项目中运行的代码解析.我也在本地运行 zend 框架.

                  我的代码有什么问题?或者有什么办法可以做同样的任务.?

                  解决方案

                  据我所知,您看到的错误是由这行代码设置的:

                  if(!is_readable($sFileName)) {$this->error = 1;返回假;}

                  由于某种原因,它无法读取您提供的文件,要么是权限/用户问题,要么是文件路径错误.

                  如果你在 *nix 服务器上,你应该确保运行网络服务器的用户有读取 excel 文件的权限.Web 服务器可能以与文件所有者不同的用户身份运行.您也可以尝试将权限设置为 666.

                  如果它只是找不到文件,提供完整路径可能会有所帮助,(例如 $data->read('/usr/local/apache2/htdocs/Excelreader/feed1.xls');

                  Hi I want to parse an excel file using zend framework. I went to Zend Developer Zone and found a solution to download phpexcelreader. I downloaded the code set a project at localhost and run the code. When I treid to read an .xlsx file it generates an error

                  The filename feed1.xlsx is not readable
                  

                  I saved the file in .xls format and run the code parsed the file successfully. Now I want to implement this in my project developed in Zend framework. I created a model, and in my project and require_onceed the excelreader at top of my project like this.

                   require_once 'Excelreader/Excel/reader.php';
                  class ExcelreaderModel extends Zend_Db_Table
                  {
                  function readFile()
                  {
                      $data = new Spreadsheet_Excel_Reader();
                  
                      // Set output Encoding.
                      $data->setOutputEncoding('CP1251');
                  
                      //$data->read('Excelreader/Excel/feed1.xls');
                      $data->read('feed1.xls');
                      echo '<pre>';
                      print_r($data);
                      echo '</pre>';
                  }
                  }
                  

                  I called this model function in my controller. But it is generating the same error which I found on localhost using .xlsx files. But I am reading .xls file which is parsed by the code running at simple project on localhost.I am also running zend framework at local.

                  What is wrong in my code? Or is there any way to do the same task.?

                  解决方案

                  As best I can tell, the error you are seeing is set by this line of code:

                  if(!is_readable($sFileName)) {
                      $this->error = 1;
                      return false;
                  }
                  

                  For one reason or another, it cannot read the file you are giving, either because there is a permissions/user issue, or the path to the file is wrong.

                  If you are on a *nix server, you should make sure the user running the webserver has permission to read the excel file. The web server probably is running as a different user than who owns the file. You can also try setting the permissions to 666.

                  If it just ins't finding the file, providing a full path may help, (e.g. $data->read('/usr/local/apache2/htdocs/Excelreader/feed1.xls');

                  这篇关于文件名 feed1.xls 在 php 中不可读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                    <bdo id='t3TOe'></bdo><ul id='t3TOe'></ul>
                    <tfoot id='t3TOe'></tfoot>

                    <legend id='t3TOe'><style id='t3TOe'><dir id='t3TOe'><q id='t3TOe'></q></dir></style></legend>
                          <tbody id='t3TOe'></tbody>

                        <small id='t3TOe'></small><noframes id='t3TOe'>

                            <i id='t3TOe'><tr id='t3TOe'><dt id='t3TOe'><q id='t3TOe'><span id='t3TOe'><b id='t3TOe'><form id='t3TOe'><ins id='t3TOe'></ins><ul id='t3TOe'></ul><sub id='t3TOe'></sub></form><legend id='t3TOe'></legend><bdo id='t3TOe'><pre id='t3TOe'><center id='t3TOe'></center></pre></bdo></b><th id='t3TOe'></th></span></q></dt></tr></i><div id='t3TOe'><tfoot id='t3TOe'></tfoot><dl id='t3TOe'><fieldset id='t3TOe'></fieldset></dl></div>