<legend id='vGtQM'><style id='vGtQM'><dir id='vGtQM'><q id='vGtQM'></q></dir></style></legend>

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

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

      使用 Zend 框架 1.7.4 上传文件

      File Upload using zend framework 1.7.4(使用 Zend 框架 1.7.4 上传文件)

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

          <tfoot id='PEqMy'></tfoot>

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

            <bdo id='PEqMy'></bdo><ul id='PEqMy'></ul>
                  <tbody id='PEqMy'></tbody>
                <i id='PEqMy'><tr id='PEqMy'><dt id='PEqMy'><q id='PEqMy'><span id='PEqMy'><b id='PEqMy'><form id='PEqMy'><ins id='PEqMy'></ins><ul id='PEqMy'></ul><sub id='PEqMy'></sub></form><legend id='PEqMy'></legend><bdo id='PEqMy'><pre id='PEqMy'><center id='PEqMy'></center></pre></bdo></b><th id='PEqMy'></th></span></q></dt></tr></i><div id='PEqMy'><tfoot id='PEqMy'></tfoot><dl id='PEqMy'><fieldset id='PEqMy'></fieldset></dl></div>
                本文介绍了使用 Zend 框架 1.7.4 上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在尝试使用 Zend Framework 1.7.4 上传文件,但没有成功.我已经阅读了 Akrabat 的教程,这很有帮助,但是当我在我的项目中使用这些技术时,我无法让它工作.

                I am trying to upload a file using Zend Framework 1.7.4, but have not been successful. I have read Akrabat's tutorial, which was helpful but when i used those techniques in my project I was not able to get it to work.

                推荐答案

                您发布的链接只是一般的 Zend Framework 教程,在 ZF 1.5 之后尚未更新.

                The link you posted is just a general Zend Framework tutorial, and hasn't been updated past ZF 1.5.

                无论如何,一旦您开始使用 Zend,这是您用来接收上传的代码示例.进行发布的表单必须具有正确的文件上传组件.

                Anyway, once you get started with Zend, this is a sample of the code you would use to receive an upload. The form doing the posting must have the correct file upload components.

                //validate file
                //for example, this checks there is exactly 1 file, it is a jpeg and is less than 512KB
                $upload = new Zend_File_Transfer_Adapter_Http();
                $upload->addValidator('Count', false, array('min' =>1, 'max' => 1))
                       ->addValidator('IsImage', false, 'jpeg')
                       ->addValidator('Size', false, array('max' => '512kB'))
                       ->setDestination('/tmp');
                
                if (!$upload->isValid()) 
                {
                    throw new Exception('Bad image data: '.implode(',', $upload->getMessages()));
                }
                
                try {
                        $upload->receive();
                } 
                catch (Zend_File_Transfer_Exception $e) 
                {
                        throw new Exception('Bad image data: '.$e->getMessage());
                }
                
                //then process your file, it's path is found by calling $upload->getFilename()
                

                这篇关于使用 Zend 框架 1.7.4 上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                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 的问题)
              1. <small id='fCSIM'></small><noframes id='fCSIM'>

                    <tbody id='fCSIM'></tbody>
                  <tfoot id='fCSIM'></tfoot>

                        <legend id='fCSIM'><style id='fCSIM'><dir id='fCSIM'><q id='fCSIM'></q></dir></style></legend>
                          <bdo id='fCSIM'></bdo><ul id='fCSIM'></ul>

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