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

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

      1. <legend id='OFrOT'><style id='OFrOT'><dir id='OFrOT'><q id='OFrOT'></q></dir></style></legend>

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

          <bdo id='OFrOT'></bdo><ul id='OFrOT'></ul>
      3. 如何在PHP中檢查上傳的文件類型

        How to check uploaded file type in PHP(如何在PHP中檢查上傳的文件類型)
        • <bdo id='VAxSm'></bdo><ul id='VAxSm'></ul>

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

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

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

                  本文介紹了如何在PHP中檢查上傳的文件類型的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  我用這段代碼來檢查圖像的類型,

                  I used this code to check for the type of images,

                  $f_type=$_FILES['fupload']['type'];
                  
                  if ($f_type== "image/gif" OR $f_type== "image/png" OR $f_type== "image/jpeg" OR $f_type== "image/JPEG" OR $f_type== "image/PNG" OR $f_type== "image/GIF")
                  {
                      $error=False;
                  }
                  else
                  {
                      $error=True;
                  }
                  

                  但有些用戶抱怨他們?cè)谏蟼魅魏晤愋偷膱D像時(shí)出錯(cuò),而有些用戶則沒有出錯(cuò)!

                  but some users complain they get an error while uploading any type of images, while some others don't get any errors!

                  我想知道這是否能解決問題:

                  I was wondering if this fixes the problem:

                  if (mime_content_type($_FILES['fupload']['type']) == "image/gif"){...

                  有什么意見嗎?

                  推薦答案

                  永遠(yuǎn)不要使用 $_FILES..['type'].其中包含的信息根本沒有經(jīng)過驗(yàn)證,它是用戶定義的值.自己測(cè)試類型.對(duì)于圖片,exif_imagetype 通常是一個(gè)不錯(cuò)的選擇選擇:

                  Never use $_FILES..['type']. The information contained in it is not verified at all, it's a user-defined value. Test the type yourself. For images, exif_imagetype is usually a good choice:

                  $allowedTypes = array(IMAGETYPE_PNG, IMAGETYPE_JPEG, IMAGETYPE_GIF);
                  $detectedType = exif_imagetype($_FILES['fupload']['tmp_name']);
                  $error = !in_array($detectedType, $allowedTypes);
                  

                  或者,finfo 函數(shù) 也很棒,如果您的服務(wù)器支持它們.

                  Alternatively, the finfo functions are great, if your server supports them.

                  這篇關(guān)于如何在PHP中檢查上傳的文件類型的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  enable SOAP on PHP(在 PHP 上啟用 SOAP)
                  Get received XML from PHP SOAP Server(從 PHP SOAP 服務(wù)器獲取接收到的 XML)
                  not a valid AllXsd value(不是有效的 AllXsd 值)
                  PHP SoapClient: SoapFault exception Could not connect to host(PHP SoapClient:SoapFault 異常無法連接到主機(jī))
                  Implementation of P_SHA1 algorithm in PHP(PHP中P_SHA1算法的實(shí)現(xiàn))
                  Sending a byte array from PHP to WCF(將字節(jié)數(shù)組從 PHP 發(fā)送到 WCF)
                  1. <i id='BNe42'><tr id='BNe42'><dt id='BNe42'><q id='BNe42'><span id='BNe42'><b id='BNe42'><form id='BNe42'><ins id='BNe42'></ins><ul id='BNe42'></ul><sub id='BNe42'></sub></form><legend id='BNe42'></legend><bdo id='BNe42'><pre id='BNe42'><center id='BNe42'></center></pre></bdo></b><th id='BNe42'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BNe42'><tfoot id='BNe42'></tfoot><dl id='BNe42'><fieldset id='BNe42'></fieldset></dl></div>

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

                    • <legend id='BNe42'><style id='BNe42'><dir id='BNe42'><q id='BNe42'></q></dir></style></legend>
                        <tbody id='BNe42'></tbody>

                      1. <tfoot id='BNe42'></tfoot>
                            <bdo id='BNe42'></bdo><ul id='BNe42'></ul>
                          • 主站蜘蛛池模板: 国产日韩欧美 | 色播视频在线观看 | 亚洲国产精品一区二区三区 | 久久久久无码国产精品一区 | 粉嫩高清一区二区三区 | 成人av网页 | 色在线看 | 狠狠干av| 夜夜骑首页 | 99精品亚洲国产精品久久不卡 | 国产黄色在线观看 | 国产在线视频网 | av中文字幕在线观看 | 欧美一级视频免费看 | 亚洲一区二区在线播放 | 久久国产精品色av免费观看 | 欧美国产亚洲一区二区 | 久久久久久国产精品三区 | 天天看片天天干 | 国产一区二区三区免费 | 亚洲一区中文字幕在线观看 | 国产一区三区视频 | 欧美日韩一区二区三区在线观看 | 欧美日韩一区二区视频在线观看 | 亚洲啊v | 亚洲一在线 | 一级看片免费视频囗交动图 | 91精品国产91久久久久久吃药 | 91福利影院 | 亚洲欧美v | 天天躁日日躁xxxxaaaa | 色视频网站免费 | a黄在线观看| 成人黄色三级毛片 | 精品美女久久久久久免费 | 欧美男人亚洲天堂 | 性一爱一乱一交一视频 | 综合九九| 久久久久久久久久久丰满 | 亚洲国产精品一区二区第一页 | 日本免费视频在线观看 |