pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

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

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

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

    2. <legend id='ccS5P'><style id='ccS5P'><dir id='ccS5P'><q id='ccS5P'></q></dir></style></legend>
      1. PHP SOAP 傳輸文件

        PHP SOAP Transferring Files(PHP SOAP 傳輸文件)
          <i id='FEFv3'><tr id='FEFv3'><dt id='FEFv3'><q id='FEFv3'><span id='FEFv3'><b id='FEFv3'><form id='FEFv3'><ins id='FEFv3'></ins><ul id='FEFv3'></ul><sub id='FEFv3'></sub></form><legend id='FEFv3'></legend><bdo id='FEFv3'><pre id='FEFv3'><center id='FEFv3'></center></pre></bdo></b><th id='FEFv3'></th></span></q></dt></tr></i><div class="zfzflvp" id='FEFv3'><tfoot id='FEFv3'></tfoot><dl id='FEFv3'><fieldset id='FEFv3'></fieldset></dl></div>
            <tbody id='FEFv3'></tbody>
            <legend id='FEFv3'><style id='FEFv3'><dir id='FEFv3'><q id='FEFv3'></q></dir></style></legend>

          • <tfoot id='FEFv3'></tfoot>
            • <bdo id='FEFv3'></bdo><ul id='FEFv3'></ul>

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

                  本文介紹了PHP SOAP 傳輸文件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在嘗試學習如何使用 PHP 和 SOAP 在客戶端和服務器之間傳輸文件(.zip 文件).目前我有一個看起來像這樣的設置:

                  I am trying to learn how to transfer files (.zip files) between a client and server using PHP and SOAP. Currently I have a set up that looks something like this:

                  require('libraries/nusoap/nusoap.php');
                  
                  $server = new nusoap_server;
                  
                  $server->configureWSDL('server', 'urn:server');
                  
                  $server->wsdl->schemaTargetNamespace = 'urn:server';
                  
                  $server->register('sendFile',
                              array('value' => 'xsd:string'),
                              array('return' => 'xsd:string'),
                              'urn:server',
                              'urn:server#sendFile');
                  

                  但是如果不是字符串,我不確定返回類型應該是什么?我正在考慮使用 base64_encode.

                  But I am unsure on what the return type should be if not a string? I am thinking of using a base64_encode.

                  推薦答案

                  為了更清楚,我已經發布了 server.php 代碼和 client.php 代碼.請看下圖:

                  To be more clear I have posted both the server.php code and client.php code. Please see below:

                  require_once('lib/nusoap.php'); //include required class for build nnusoap web service server
                  
                    // Create server object
                     $server = new soap_server();
                  
                     // configure  WSDL
                     $server->configureWSDL('Upload File', 'urn:uploadwsdl');
                  
                     // Register the method to expose
                      $server->register('upload_file',                                 // method
                          array('file' => 'xsd:string','location' => 'xsd:string'),    // input parameters
                          array('return' => 'xsd:string'),                             // output parameters
                          'urn:uploadwsdl',                                            // namespace
                          'urn:uploadwsdl#upload_file',                                // soapaction
                          'rpc',                                                       // style
                          'encoded',                                                   // use
                          'Uploads files to the server'                                // documentation
                      );
                  
                      // Define the method as a PHP function
                  
                      function upload_file($encoded,$name) {
                          $location = "uploads\".$name;                               // Mention where to upload the file
                          $current = file_get_contents($location);                     // Get the file content. This will create an empty file if the file does not exist     
                          $current = base64_decode($encoded);                          // Now decode the content which was sent by the client     
                          file_put_contents($location, $current);                      // Write the decoded content in the file mentioned at particular location      
                          if($name!="")
                          {
                              return "File Uploaded successfully...";                      // Output success message                              
                          }
                          else        
                          {
                              return "Please upload a file...";
                          }
                      }
                  
                      // Use the request to (try to) invoke the service
                      $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
                      $server->service($HTTP_RAW_POST_DATA); 
                  

                  ====================================================================

                  =====================================================================

                  require_once('lib/nusoap.php'); //include required class for build nnusoap web service server
                     $wsdl="http://localhost:81/subhan/webservice3/server.php?wsdl";  // SOAP Server
                  
                     if($_POST['submit'])
                     {
                         $tmpfile = $_FILES["uploadfiles"]["tmp_name"];   // temp filename
                         $filename = $_FILES["uploadfiles"]["name"];      // Original filename
                  
                         $handle = fopen($tmpfile, "r");                  // Open the temp file
                         $contents = fread($handle, filesize($tmpfile));  // Read the temp file
                         fclose($handle);                                 // Close the temp file
                  
                         $decodeContent   = base64_encode($contents);     // Decode the file content, so that we code send a binary string to SOAP
                      }   
                  
                     $client=new soapclient($wsdl) or die("Error");   // Connect the SOAP server
                     $response = $client->__call('upload_file',array($decodeContent,$filename)) or die("Error");  //Send two inputs strings. {1} DECODED CONTENT {2} FILENAME
                  
                     // Check if there is anny fault with Client connecting to Server
                     if($client->fault){
                          echo "Fault {$client->faultcode} <br/>";
                          echo "String {$client->faultstring} <br/>";
                     }
                     else{
                          print_r($response); // If success then print response coming from SOAP Server
                     }
                  
                  
                  <form name="name1" method="post" action="" enctype="multipart/form-data">
                  <input type="file" name="uploadfiles"><br />
                  <input type="submit" name="submit" value="uploadSubmit"><br />
                  </form>
                  

                  ================================================

                  =================================================

                  您需要做的就是下載 nusoap.php,它將在soap 庫中看到 http://sourceforge.net/projects/nusoap/

                  All you need to do is download the nusoap.php which will be seen in soap library http://sourceforge.net/projects/nusoap/

                  這是經過全面測試的,它將 100% 正常工作.

                  This is fully tested and it will 100% work without fail.

                  這篇關于PHP SOAP 傳輸文件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)

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

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

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

                        • <tfoot id='BykBk'></tfoot>
                          • <bdo id='BykBk'></bdo><ul id='BykBk'></ul>
                              <tbody id='BykBk'></tbody>
                            主站蜘蛛池模板: 上海物流公司,上海货运公司,上海物流专线-优骐物流公司 | 寮步纸箱厂_东莞纸箱厂 _东莞纸箱加工厂-东莞市寮步恒辉纸制品厂 | 领袖户外_深度旅游、摄影旅游、小团慢旅行、驴友网 | 吸污车_吸粪车_抽粪车_电动三轮吸粪车_真空吸污车_高压清洗吸污车-远大汽车制造有限公司 | 荣事达手推洗地机_洗地机厂家_驾驶式扫地机_工业清洁设备 | 森旺-A级防火板_石英纤维板_不燃抗菌板装饰板_医疗板 | 南京兰江泵业有限公司-水解酸化池潜水搅拌机-絮凝反应池搅拌机-好氧区潜水推进器 | 佛山商标注册_商标注册代理|专利注册申请_商标注册公司_鸿邦知识产权 | 光伏家 - 太阳能光伏发电_分布式光伏发电_太阳能光伏网 | AGV无人叉车_激光叉车AGV_仓储AGV小车_AGV无人搬运车-南昌IKV机器人有限公司[官网] | H型钢切割机,相贯线切割机,数控钻床,数控平面钻,钢结构设备,槽钢切割机,角钢切割机,翻转机,拼焊矫一体机 | 工控机,嵌入式主板,工业主板,arm主板,图像采集卡,poe网卡,朗锐智科 | 泉州陶瓷pc砖_园林景观砖厂家_石英砖地铺石价格 _福建暴风石英砖 | 亳州网络公司 - 亳州网站制作 - 亳州网站建设 - 亳州易天科技 | 河南不锈钢水箱_地埋水箱_镀锌板水箱_消防水箱厂家-河南联固供水设备有限公司 | 深圳富泰鑫五金_五金冲压件加工_五金配件加工_精密零件加工厂 | 渣油泵,KCB齿轮泵,不锈钢齿轮泵,重油泵,煤焦油泵,泊头市泰邦泵阀制造有限公司 | 【德信自动化】点胶机_全自动点胶机_自动点胶机厂家_塑料热压机_自动螺丝机-深圳市德信自动化设备有限公司 | 对照品_中药对照品_标准品_对照药材_「格利普」高纯中药标准品厂家-成都格利普生物科技有限公司 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库 | 北京康百特科技有限公司-分子蒸馏-短程分子蒸馏设备-实验室分子蒸馏设备 | 影像测量仪_三坐标测量机_一键式二次元_全自动影像测量仪-广东妙机精密科技股份有限公司 | 苹果售后维修点查询,苹果iPhone授权售后维修服务中心 – 修果网 拼装地板,悬浮地板厂家,悬浮式拼装运动地板-石家庄博超地板科技有限公司 | 校车_校车价格_19座幼儿园校车_幼儿园校车_大鼻子校车 | 传爱自考网_传爱自学考试网 | 薪动-人力资源公司-灵活用工薪资代发-费用结算-残保金优化-北京秒付科技有限公司 | 光照全温振荡器(智能型)-恒隆仪器| 医学模型生产厂家-显微手术模拟训练器-仿真手术模拟训练系统-北京医教科技 | 塑料撕碎机_编织袋撕碎机_废纸撕碎机_生活垃圾撕碎机_废铁破碎机_河南鑫世昌机械制造有限公司 | 综合管廊模具_生态,阶梯护坡模具_检查井模具制造-致宏模具厂家 | 混合气体腐蚀试验箱_盐雾/硫化氢/气体腐蚀试验箱厂家-北京中科博达 | 智能汉显全自动量热仪_微机全自动胶质层指数测定仪-鹤壁市科达仪器仪表有限公司 | 电磁辐射仪-电磁辐射检测仪-pm2.5检测仪-多功能射线检测仪-上海何亦仪器仪表有限公司 | 单级/双级旋片式真空泵厂家,2xz旋片真空泵-浙江台州求精真空泵有限公司 | 步入式高低温测试箱|海向仪器| 不锈钢酒柜|恒温酒柜|酒柜定制|酒窖定制-上海啸瑞实业有限公司 | 耐酸碱胶管_耐腐蚀软管总成_化学品输送软管_漯河利通液压科技耐油耐磨喷砂软管|耐腐蚀化学软管 | 清管器,管道清管器,聚氨酯发泡球,清管球 - 承德嘉拓设备 | 淋巴细胞分离液_口腔医疗器材-精欣华医疗器械(无锡)有限公司 | 大倾角皮带机-皮带输送机-螺旋输送机-矿用皮带输送机价格厂家-河南坤威机械 | 挤奶设备过滤纸,牛奶过滤纸,挤奶机过滤袋-济南蓝贝尔工贸有限公司 | 分子精馏/精馏设备生产厂家-分子蒸馏工艺实验-新诺舜尧(天津)化工设备有限公司 |