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

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

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

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

      2. <tfoot id='GdXfc'></tfoot>

      3. 如何獲取html中的文件路徑<input type="file&q

        How to get the file path in html lt;input type=quot;filequot;gt; in PHP?(如何獲取html中的文件路徑input type=file在 PHP 中?)

        • <bdo id='ELhCU'></bdo><ul id='ELhCU'></ul>
              <tbody id='ELhCU'></tbody>
              • <legend id='ELhCU'><style id='ELhCU'><dir id='ELhCU'><q id='ELhCU'></q></dir></style></legend>

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

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

                  本文介紹了如何獲取html中的文件路徑<input type="file">在 PHP 中?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問題描述

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

                  誰(shuí)能告訴我如何在 PHP 中使用 html <input type="file"> 獲取文件路徑?

                  Can somebody pls tell me how to get the filepath using html <input type="file"> in PHP?

                  這是我的代碼:

                  index.php

                  <form action="csv_to_database.php" method="get" >
                   <input type="file" name="csv_file" />
                   <input type="submit" name="upload" value="Upload" />
                  </form>
                  

                  csv_to_database.php

                  <?php
                  
                   if (isset($_GET['csv_file'])) {
                  
                   $row = 1;
                  
                    if (($handle = fopen($_GET['csv_file'], "r")) !== FALSE) {
                     while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
                      $num = count($data);
                      echo "<p> $num fields in line $row: <br /></p>
                  ";
                      $row++;
                      for ($c=0; $c < $num; $c++) {
                          echo $data[$c] . "<br />
                  ";
                      }
                     }
                     fclose($handle);
                    }
                  
                   } 
                  ?>
                  

                  我的問題是,它僅在 csv 數(shù)據(jù)與我的 php 文件位于同一目錄中時(shí)才有效.我想我需要獲取文件路徑,但我不知道該怎么做.

                  My problem is, it only works when the csv data is in the same directory as my php files. I think I need to get the file path but I don't know how to do it.

                  推薦答案

                  你不應(yīng)該只使用你現(xiàn)在擁有的 $_GET.您的文件基于 $_FILES["csv_file"]["tmp_name"].

                  You shouldn't just use the $_GET you've got now. Your file is based in $_FILES["csv_file"]["tmp_name"].

                  最好閱讀本教程,基本上說你需要做這樣的事情:

                  Best you review this tutorial, that basically says you need to do something like this:

                  <?php
                  if ($_FILES["csv_file"]["error"] > 0)
                    {
                    echo "Error: " . $_FILES["csv_file"]["error"] . "<br />";
                    }
                  else
                    {
                    echo "Upload: " . $_FILES["csv_file"]["name"] . "<br />";
                    echo "Type: " . $_FILES["csv_file"]["type"] . "<br />";
                    echo "Size: " . ($_FILES["csv_file"]["size"] / 1024) . " Kb<br />";
                    echo "Stored in: " . $_FILES["csv_file"]["tmp_name"];
                    }
                  ?>
                  

                  你可以從那里去.如果您想從臨時(shí)位置移動(dòng)文件,請(qǐng)使用 move_uploaded_file,教程中也有說明:)

                  And you can go from there. Use move_uploaded_file if you want to move the file from the temp location, also explained in the tutorial :)

                  這篇關(guān)于如何獲取html中的文件路徑<input type="file">在 PHP 中?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lá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 異常無(wú)法連接到主機(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)

                  <small id='2koSW'></small><noframes id='2koSW'>

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

                              <tbody id='2koSW'></tbody>
                            主站蜘蛛池模板: 日韩精品一区二区三区四区视频 | 免费在线a视频 | 天天夜干 | 国产精品美女一区二区 | 日韩欧美中文在线 | 久久精品亚洲精品国产欧美 | 亚洲激情在线观看 | 欧美成人一区二区 | 亚洲一区二区在线电影 | 在线久草 | 亚洲黄色片免费观看 | 精品美女在线观看视频在线观看 | 国产一区在线视频 | 精品久久久久一区二区国产 | 欧美日韩免费在线 | 亚洲色图综合网 | 国精产品一区二区三区 | 九九亚洲精品 | 精品国产三级 | 亚洲日韩中文字幕 | 爱操av| 伊人狠狠操 | 婷婷久久五月天 | 精品一区二区三区在线观看 | 日韩中文字幕免费在线 | 日本高清视频在线播放 | av网址在线播放 | 午夜影院在线观看 | 亚洲国产aⅴ成人精品无吗 欧美激情欧美激情在线五月 | 91欧美| 妞干网视频 | 亭亭五月激情 | 日韩国产欧美一区 | 蜜桃一区| 国产精品视频一 | 国产免费一区二区三区 | 浮生影院免费观看中文版 | 99国产精品久久久 | 国产高清在线 | 亚洲午夜av久久乱码 | 国产区第一页 |