12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- header("Content-type: text/html; charset=utf-8");
- Action_Upload();
- function Action_Upload(){
- $furl="C:\\1.jpg";
- $url = 'https://openapi-test.tianquetech.com/merchant/uploadPicture';
- $res = upload_file_to_cdn($furl, $url);
-
-
- }
- function upload_file_to_cdn($furl,$url){
-
- $ch = curl_init();
-
- $post_data = array (
-
- "file" =>new CurlFile($furl),
- 'orgId'=>'26680846',
- 'pictureType'=>'04',
- 'reqId'=>'323ds7674354fds32fdsda60174',
- );
-
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
- curl_setopt($ch, CURLOPT_HEADER, 0);
-
-
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_TIMEOUT, 100);
-
-
-
-
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
-
- $data = curl_exec($ch);
- if($data === FALSE)
- {
- echo "<br/>"," cUrl Error:".curl_error($ch);
- }
-
- curl_close($ch);
- }
- ?>
|