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

  • <legend id='b78eH'><style id='b78eH'><dir id='b78eH'><q id='b78eH'></q></dir></style></legend>
      <bdo id='b78eH'></bdo><ul id='b78eH'></ul>
    1. <small id='b78eH'></small><noframes id='b78eH'>

        PHP 上传文件

        PHP Uploading Files(PHP 上传文件)

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

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

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

        • <tfoot id='o4Pl8'></tfoot>
          • <bdo id='o4Pl8'></bdo><ul id='o4Pl8'></ul>

                    <tbody id='o4Pl8'></tbody>
                  本文介绍了PHP 上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在用 PHP 上传文件时遇到问题.当我提交时, $_FILES[] 为空.我觉得这是一个非常n00b的问题:/

                  我的表格:

                  <form method="post" action="uploadfile.php"><输入类型=隐藏"名称=MAX_FILE_SIZE"值=300000"/>图片:<input name="ImageFile" type="file"/><br/><input type="submit" value="添加图片"/><br/></表格>

                  相关php.ini:

                  <上一页>;;;;;;;;;;;;;;;;;文件上传;;;;;;;;;;;;;;;;;;是否允许 HTTP 文件上传.文件上传 = 开;HTTP 上传文件的临时目录(如果没有,将使用系统默认值);指定的).upload_tmp_dir = "c:php5upload";上传文件的最大允许大小.upload_max_filesize = 300M

                  c:php5upload 可由 IUSR_HOSTNAME 写入

                  还有什么我应该检查的想法吗?

                  解决方案

                  确保你的表单标签有这个属性:enctype="multipart/form-data"

                  没有它,文件将无法上传.

                  I'm having a problem uploading files in PHP. When I submit, $_FILES[] is empty. I feel like this is such a n00b question :/

                  My form:

                  <form method="post" action="uploadfile.php">
                  <input type="hidden" name="MAX_FILE_SIZE" value="300000" />
                  Image: <input name="ImageFile" type="file" /><br />
                  <input type="submit" value="Add Image" /><br />
                  </form>
                  

                  Relevant php.ini:

                  ;;;;;;;;;;;;;;;;
                  ; File Uploads ;
                  ;;;;;;;;;;;;;;;;
                  
                  ; Whether to allow HTTP file uploads.
                  file_uploads = On
                  
                  ; Temporary directory for HTTP uploaded files (will use system default if not
                  ; specified).
                  upload_tmp_dir = "c:php5upload"
                  
                  ; Maximum allowed size for uploaded files.
                  upload_max_filesize = 300M
                  

                  c:php5upload is writable by IUSR_HOSTNAME

                  Any thoughts on what else I should check?

                  解决方案

                  Make sure your form tag has this attribute: enctype="multipart/form-data"

                  Without it the files will not get uploaded.

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

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

                  相关文档推荐

                  PHP Upload File Validation(PHP 上传文件验证)
                  PHP Error - Uploading a file(PHP 错误 - 上传文件)
                  How can I write tests for file upload in PHP?(如何在 PHP 中编写文件上传测试?)
                  php resizing image on upload rotates the image when i don#39;t want it to(php在上传时调整图像大小会在我不想要它时旋转图像)
                  How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
                  change button text in js/ajax after mp4 =gt;mp3 conversion in php(在 php 中的 mp4 =gt;mp3 转换后更改 js/ajax 中的按钮文本)
                    <bdo id='sxREF'></bdo><ul id='sxREF'></ul>

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

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