久久久久久久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 中?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  誰能告訴我如何在 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 數據與我的 php 文件位于同一目錄中時才有效.我想我需要獲取文件路徑,但我不知道該怎么做.

                  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.

                  推薦答案

                  你不應該只使用你現在擁有的 $_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"];
                    }
                  ?>
                  

                  你可以從那里去.如果您想從臨時位置移動文件,請使用 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 :)

                  這篇關于如何獲取html中的文件路徑<input type="file">在 PHP 中?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='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>
                            主站蜘蛛池模板: 亚洲精品在线观看视频 | 天天干精品 | 久久国产综合 | 看毛片的网站 | 一级h片| 亚洲欧美日韩在线不卡 | 亚洲精品中文字幕在线观看 | 自拍第1页| 成人av久久| 91精品一区二区三区久久久久久 | 一道本视频 | 日本精品一区 | 在线国产一区 | 狠狠色狠狠色综合日日92 | 亚洲最大福利网 | 亚洲成a人片 | 久久精品男人的天堂 | a级在线免费视频 | 国产视频久久 | 久草成人网 | 久草院线 | 亚州无限乱码 | 日韩欧美视频免费在线观看 | 久久精品中文字幕 | 亚洲欧美成人 | 午夜欧美一区二区三区在线播放 | 99免费看 | 日韩字幕一区 | 久久小视频 | 特级特黄特色的免费大片 | 亚洲精品2区| 国产大毛片 | 成人高潮片免费视频欧美 | 日本精品在线观看 | 黄色免费av | 国产在线永久免费 | 天天拍天天射 | 99精品免费 | 一级毛片免费完整视频 | japanhdxxxx裸体| 国产一级视频在线 |