説明なし

fileTest.php 934B

1234567891011121314151617181920212223242526
  1. <?php
  2. include "TopSdk.php";
  3. date_default_timezone_set('Asia/Shanghai');
  4. $c = new TopClient;
  5. $c->appkey = '12497914';
  6. $c->secretKey = '4b0f28396e072d67fae169684613bcd1';
  7. // $req = new TradeVoucherUploadRequest;
  8. // $req->setFileName("example");
  9. // $req->setFileData("@/Users/xt/Downloads/1.jpg");
  10. // $req->setSellerNick("奥利奥官方旗舰店");
  11. // $req->setBuyerNick("101NufynDYcbjf2cFQDd62j8M/mjtyz6RoxQ2OL1c0e/Bc=");
  12. // var_dump($c->execute($req));
  13. $req2 = new TradeVoucherUploadRequest;
  14. $req2->setFileName("example");
  15. $myPic = array(
  16. 'type' => 'application/octet-stream',
  17. 'content' => file_get_contents('/Users/xt/Downloads/1.jpg')
  18. );
  19. $req2->setFileData($myPic);
  20. $req2->setSellerNick("奥利奥官方旗舰店");
  21. $req2->setBuyerNick("101NufynDYcbjf2cFQDd62j8M/mjtyz6RoxQ2OL1c0e/Bc=");
  22. var_dump($c->execute($req2));
  23. ?>