<tfoot id='zDWjO'></tfoot>
  • <legend id='zDWjO'><style id='zDWjO'><dir id='zDWjO'><q id='zDWjO'></q></dir></style></legend>

      1. <small id='zDWjO'></small><noframes id='zDWjO'>

          <bdo id='zDWjO'></bdo><ul id='zDWjO'></ul>

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

      2. 如何获取上传到 FTP 服务器的文件的 HTTP URL

        时间:2023-10-30

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

          <tfoot id='MV675'></tfoot>
                <tbody id='MV675'></tbody>
                <bdo id='MV675'></bdo><ul id='MV675'></ul>

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

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

                  本文介绍了如何获取上传到 FTP 服务器的文件的 HTTP URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  以下是我将文件上传到其他服务器的代码,

                  Below is my code to upload file to other server ,

                  $ftp_server="host";
                  $ftp_user_name="";
                  $ftp_user_pass="";
                  $file = "referesh.php";//tobe uploaded
                  $name = "diff_adtaggeneration";
                  $remote_file = $name."/referesh.php";
                  
                  // set up basic connection
                  $conn_id = ftp_connect($ftp_server);
                  
                  // login with username and password
                  $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
                  
                  $res = ftp_rawlist($conn_id, $name);
                  //print_r($_SERVER);exit;
                  if(count($res) > 0)
                  {
                  
                      ftp_put($conn_id, $remote_file, $file, FTP_ASCII);
                  }
                  else
                  {
                      ftp_mkdir($conn_id, $name);
                      ftp_put($conn_id, $remote_file, $file, FTP_ASCII);
                  }
                  
                  ftp_close($conn_id); 
                  

                  上面的代码完美运行,文件成功上传到其他服务器,新文件夹名称'diff_adtaggeneration'将在目录的根目录中创建,文件上传到该文件夹,我需要获取上传的文件路径..!我使用 print_r($_SERVER) ,我知道这仅显示当前服务器详细信息,但如何获取上传服务器(其他服务器)的根目录完整文件路径.任何帮助表示赞赏...

                  above code works perfectly, the file succesfully uploaded to other server, the new folder name 'diff_adtaggeneration' will create in root of the directory and file uploaded in that folder, and I need to get the uploaded file path ..! I use print_r($_SERVER) , I know this shows only current server details, but how to get the root directory full file path of uploaded server(other server). Any help appreciated...

                  推荐答案

                  没有神奇的方法可以找到上传到 FTP 服务器的文件的 HTTP URL,恰好与 HTTP 服务器共享一个文件存储.

                  There's no magical way to find out an HTTP URL of the file uploaded to an FTP server, that happens to share a file storage with the HTTP server.

                  p>

                  这是 FTP 和 HTTP 服务器的配置问题;它们如何将虚拟 HTTP 和 FTP 路径映射到实际的文件系统路径.

                  It's a matter of configuration of both the FTP and HTTP servers; how do they map virtual HTTP and FTP paths to and from an actual file system paths.

                  映射可以是完全虚拟的和不确定的.

                  The mapping can be completely virtual and undeterministic.

                  话虽如此,大多数网络托管在 FTP 和 HTTP 上都有一定的根,从那里映射是确定性的.

                  Having that said, most web hostings have some root both on FTP and HTTP, from where the mapping is deteministics.

                  如果您连接到 FTP,您通常会进入 HTTP 主机的根文件夹,或者直接位于其下方(会有一个子文件夹,例如 httpdocswww映射到 HTTP 根目录).

                  If you connect to the FTP, you usually land in the root folder of the HTTP hosting, or immediately below it (there would be a subfolder like httpdocs or www that maps to the HTTP root).

                  如果 FTP 帐户是 chrooted,根文件夹将是 /(或 /httpdocs 等).

                  If the FTP account is chrooted, the root folder will be / (or /httpdocs, etc).

                  如果您有自己的域 (www.example.com),那么像 /index.html 这样的 FTP 路径会映射到 https://www.example.com/index.html.

                  If you have your own domain (www.example.com), then an FTP path like /index.html maps to https://www.example.com/index.html.

                  这是最简单的情况.它可以是一种更复杂的方式.但这是我们无法帮助您的事情.这是您的网络托管服务提供商和/或管理员的问题.

                  That's the most simple case. It can be a way more complicated. But that's something we cannot help you with. That's a question for your web hosting provider and/or administrator.

                  这篇关于如何获取上传到 FTP 服务器的文件的 HTTP URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Joomla 2.5 比 Joomla 1.5 Querywise 快得多吗 下一篇:为 PDF 创建安全文件托管服务器

                  相关文章

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

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