<tfoot id='Rjtsb'></tfoot>
  • <small id='Rjtsb'></small><noframes id='Rjtsb'>

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

        <legend id='Rjtsb'><style id='Rjtsb'><dir id='Rjtsb'><q id='Rjtsb'></q></dir></style></legend>
        • <bdo id='Rjtsb'></bdo><ul id='Rjtsb'></ul>
      1. 将文件上传器添加到 Joomla 管理组件

        Add File Uploader to Joomla Admin Component(将文件上传器添加到 Joomla 管理组件)
        <i id='lUK92'><tr id='lUK92'><dt id='lUK92'><q id='lUK92'><span id='lUK92'><b id='lUK92'><form id='lUK92'><ins id='lUK92'></ins><ul id='lUK92'></ul><sub id='lUK92'></sub></form><legend id='lUK92'></legend><bdo id='lUK92'><pre id='lUK92'><center id='lUK92'></center></pre></bdo></b><th id='lUK92'></th></span></q></dt></tr></i><div id='lUK92'><tfoot id='lUK92'></tfoot><dl id='lUK92'><fieldset id='lUK92'></fieldset></dl></div>

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

        <legend id='lUK92'><style id='lUK92'><dir id='lUK92'><q id='lUK92'></q></dir></style></legend>
      2. <tfoot id='lUK92'></tfoot>

              <tbody id='lUK92'></tbody>
            • <bdo id='lUK92'></bdo><ul id='lUK92'></ul>

                  本文介绍了将文件上传器添加到 Joomla 管理组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我根据 Joomla 指南制作了 Joomla 管理组件 - http://docs.joomla.org/Developing_a_Model-View-Controller_Component/2.5/Developing_a_Basic_Component

                  I made Joomla admin component according to Joomla guide - http://docs.joomla.org/Developing_a_Model-View-Controller_Component/2.5/Developing_a_Basic_Component

                  因为我需要有文件上传器,让用户上传单个文件.

                  In that i need to have file uploader which let user to upload single file.

                  在administratorcomponentscom_invoicemanagermodelsformsinvoicemanager.xml 中我已经定义了

                  In administratorcomponentscom_invoicemanagermodelsformsinvoicemanager.xml i have defined

                  <field name="invoice" type="file"/>
                  

                  在控制器 administratorcomponentscom_invoicemanagercontrollersinvoicemanager.php 中,我尝试检索该文件,如下所示.但它不起作用(无法检索文件)

                  In the controller administratorcomponentscom_invoicemanagercontrollersinvoicemanager.php im trying to retrieve that file like below. But its not working (can't retrieve file)

                  我哪里做错了?

                  如何获取文件并将其保存在磁盘上?

                  How can i get file and save it on disk ?

                  class InvoiceManagerControllerInvoiceManager extends JControllerForm
                  {
                      function save(){
                          $file = JRequest::getVar( 'invoice', '', 'files', 'array' );
                          var_dump($file);
                          exit(0);
                      }
                  }
                  

                  推荐答案

                  确保您在提交文件的表单中包含了 enctype="multipart/form-data".这是一个常见的错误

                  make sure that you have included enctype="multipart/form-data" in the form that the file is being submitting. This is a common mistake

                  /// Get the file data array from the request.
                  $file = JRequest::getVar( 'Filedata', '', 'files', 'array' ); 
                  
                  /// Make the file name safe.
                  jimport('joomla.filesystem.file');
                  $file['name'] = JFile::makeSafe($file['name']);
                  
                  /// Move the uploaded file into a permanent location.
                  if (isset( $file['name'] )) {
                  
                  /// Make sure that the full file path is safe.
                  $filepath = JPath::clean( $somepath.'/'.strtolower( $file['name'] ) );
                  
                  /// Move the uploaded file.
                  JFile::upload( $file['tmp_name'], $filepath );}
                  

                  这篇关于将文件上传器添加到 Joomla 管理组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 的问题)
                  <legend id='7arfx'><style id='7arfx'><dir id='7arfx'><q id='7arfx'></q></dir></style></legend>
                1. <i id='7arfx'><tr id='7arfx'><dt id='7arfx'><q id='7arfx'><span id='7arfx'><b id='7arfx'><form id='7arfx'><ins id='7arfx'></ins><ul id='7arfx'></ul><sub id='7arfx'></sub></form><legend id='7arfx'></legend><bdo id='7arfx'><pre id='7arfx'><center id='7arfx'></center></pre></bdo></b><th id='7arfx'></th></span></q></dt></tr></i><div id='7arfx'><tfoot id='7arfx'></tfoot><dl id='7arfx'><fieldset id='7arfx'></fieldset></dl></div>
                  <tfoot id='7arfx'></tfoot>
                      <tbody id='7arfx'></tbody>

                  • <small id='7arfx'></small><noframes id='7arfx'>

                        • <bdo id='7arfx'></bdo><ul id='7arfx'></ul>