久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

        <bdo id='yETbW'></bdo><ul id='yETbW'></ul>
    1. <tfoot id='yETbW'></tfoot>

        PHP:UPLOAD_ERR_INI_SIZE 有什么意義?

        PHP: What#39;s the point of UPLOAD_ERR_INI_SIZE?(PHP:UPLOAD_ERR_INI_SIZE 有什么意義?)
        <legend id='SGGWd'><style id='SGGWd'><dir id='SGGWd'><q id='SGGWd'></q></dir></style></legend>
          <bdo id='SGGWd'></bdo><ul id='SGGWd'></ul>

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

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

                • 本文介紹了PHP:UPLOAD_ERR_INI_SIZE 有什么意義?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  PHP 手冊中有一個部分叫做處理文件上傳.該部分有一個名為錯誤消息說明的小節.該小節描述了一個名為UPLOAD_ERR_INI_SIZE"的錯誤:

                  值:1;上傳的文件超過了 upload_max_filesize 指令在 php.ini 中.

                  但是,根據我的經驗,不可能使用 UPLOAD_ERR_INI_SIZE 檢查這個特定錯誤,因為如果用戶確實上傳了超過 php.ini 中的 upload_max_filesize 指令的文件,則 $_FILES 超全局變量是空的.想親自測試一下嗎?將其另存為upload_test.php",然后嘗試上傳低于限制的文件,然后上傳超過限制的文件:

                  <!DOCTYPE html><html lang="zh-cn"><頭><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>PHP 上傳測試</title><身體><h1>上傳文件(最大文件大小:<?php echo $max_filesize_in_mib; ?> MiB)</h1><form action="upload_test.php?submitted=true" enctype="multipart/form-data" method="post"><input type="file" name="upload_test"><input type="hidden" name="random_field" value="您應該在 $_POST 超全局變量中看到這個字段."><輸入類型=提交"值=上傳"></表單>

                  所以我的問題是:如果您永遠無法檢查 UPLOAD_ERR_INI_SIZE 有什么意義?

                  解決方案

                  UPLOAD_ERR_INI_SIZE 值:1;上傳的文件超過了 php.ini 中的 upload_max_filesize 指令.

                  當您的 POST_MAX_SIZE 大于 UPLOAD_MAX_FILESIZE 時,這是有道理的.

                  我在 POST_MAX_SIZE128MB 的環境中嘗試過,然后我將 UPLOAD_MAX_FILESIZE 設置為 1MB

                  這是我得到的(正如預期的那樣):

                  <前>$_POST 的內容:大批([random_field] => 您應該在 $_POST 超全局變量中看到此字段.)$_FILES 的內容:大批([upload_test] => 數組([名稱] => Scan.tiff[類型] =>[tmp_name] =>[錯誤] => 1[尺寸] => 0))

                  雖然我們沒有得到文件的大小,但我們知道它超過了upload_max_filesize.

                  The PHP manual has a section called Handling file uploads. That section has a subsection called Error Messages Explained. That subsection describes an error called "UPLOAD_ERR_INI_SIZE":

                  Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.

                  However, in my experience, it's impossible to ever check for this particular error using UPLOAD_ERR_INI_SIZE because if a user ever does upload a file that exceeds the upload_max_filesize directive in php.ini, the $_FILES superglobal is empty. Want to test it for yourself? Save this as "upload_test.php" and then try to upload a file that's under the limit and then a file that's over the limit:

                  <?php
                  
                      if (isset($_GET['submitted']) && $_GET['submitted'] === 'true')
                      {
                          echo 'Contents of $_POST:<hr><pre>';
                          print_r($_POST);
                          echo '</pre><hr>Contents of $_FILES:<hr><pre>';
                          print_r($_FILES);
                          echo '</pre><hr>';
                          exit;
                      }
                  
                      $max_filesize_in_mib = min((int)(ini_get('upload_max_filesize')), (int)(ini_get('post_max_size')), (int)(ini_get('memory_limit')));
                  
                  ?>
                  <!DOCTYPE html>
                  <html lang="en">
                      <head>
                          <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
                          <title>PHP Upload Test</title>
                      </head>
                      <body>
                          <h1>Upload a File (Maximum File Size: <?php echo $max_filesize_in_mib; ?> MiB)</h1>
                          <form action="upload_test.php?submitted=true" enctype="multipart/form-data" method="post">
                              <input type="file" name="upload_test">
                              <input type="hidden" name="random_field" value="You should see this field in the $_POST superglobal.">
                              <input type="submit" value="Upload">
                          </form>
                      </body>
                  </html>
                  

                  So my question is this: what's the point of UPLOAD_ERR_INI_SIZE if you can never check for it?

                  解決方案

                  UPLOAD_ERR_INI_SIZE Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.

                  This make sense when your POST_MAX_SIZE is bigger than UPLOAD_MAX_FILESIZE.

                  I tried in an environment where POST_MAX_SIZE is 128MB, then i set UPLOAD_MAX_FILESIZE to 1MB

                  Here's what i got (as expected):

                  Contents of $_POST:
                  Array
                  (
                      [random_field] => You should see this field in the $_POST superglobal.
                  )
                  
                  Contents of $_FILES:
                  Array
                  (
                      [upload_test] => Array
                          (
                              [name] => Scan.tiff
                              [type] => 
                              [tmp_name] => 
                              [error] => 1
                              [size] => 0
                          )
                  )
                  

                  Although we don't get the size of the file, we do know that it's exceeding the upload_max_filesize.

                  這篇關于PHP:UPLOAD_ERR_INI_SIZE 有什么意義?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  enable SOAP on PHP(在 PHP 上啟用 SOAP)
                  Get received XML from PHP SOAP Server(從 PHP SOAP 服務器獲取接收到的 XML)
                  not a valid AllXsd value(不是有效的 AllXsd 值)
                  PHP SoapClient: SoapFault exception Could not connect to host(PHP SoapClient:SoapFault 異常無法連接到主機)
                  Implementation of P_SHA1 algorithm in PHP(PHP中P_SHA1算法的實現)
                  Sending a byte array from PHP to WCF(將字節數組從 PHP 發送到 WCF)

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

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

                          <tbody id='TJfip'></tbody>

                      1. <i id='TJfip'><tr id='TJfip'><dt id='TJfip'><q id='TJfip'><span id='TJfip'><b id='TJfip'><form id='TJfip'><ins id='TJfip'></ins><ul id='TJfip'></ul><sub id='TJfip'></sub></form><legend id='TJfip'></legend><bdo id='TJfip'><pre id='TJfip'><center id='TJfip'></center></pre></bdo></b><th id='TJfip'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='TJfip'><tfoot id='TJfip'></tfoot><dl id='TJfip'><fieldset id='TJfip'></fieldset></dl></div>
                        <legend id='TJfip'><style id='TJfip'><dir id='TJfip'><q id='TJfip'></q></dir></style></legend>
                      2. <tfoot id='TJfip'></tfoot>
                          • 主站蜘蛛池模板: 欧美激情一区二区三区 | 中文字幕亚洲视频 | 精品国产乱码久久久久久闺蜜 | 99热成人在线 | chinese中国真实乱对白 | 欧美精品一区二区三区在线 | 91精品福利| 国产精品久久九九 | 成人免费毛片片v | 欧美亚洲激情 | 中文成人在线 | 成人影院在线观看 | 草久免费视频 | 古装三级在线播放 | 玖玖视频 | 欧美精品福利视频 | 国产日韩一区二区 | 成人午夜黄色 | 欧美精品欧美精品系列 | 一级全黄视频 | 一级全黄少妇性色生活免费看 | 亚洲精品久久久久久国产精华液 | 久久久久久免费毛片精品 | 天天人人精品 | 在线观看亚洲专区 | 亚洲成人99| 欧美日韩国产不卡 | 在线免费观看成人 | 亚洲一区二区三区在线播放 | 91一区| 国产精品久久久久久久久久久久冷 | 精品国产一区二区国模嫣然 | 中文字幕11页 | 视频1区2区 | 中文字幕在线一区 | 久草电影网 | 久久视频一区 | 九色av | 国产精品成人一区二区三区 | 先锋资源网 | 999精品视频在线观看 |