wupengfei 2 years ago
parent
commit
027bed1aa1
2 changed files with 4 additions and 6 deletions
  1. 1 2
      .idea/workspace.xml
  2. 3 4
      application/common.php

+ 1 - 2
.idea/workspace.xml

@@ -3,7 +3,6 @@
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/api/controller/Upload.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Upload.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/common.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
@@ -271,7 +270,7 @@
       <workItem from="1679532313623" duration="31448000" />
       <workItem from="1679619041819" duration="29965000" />
       <workItem from="1679706054685" duration="19035000" />
-      <workItem from="1679878121007" duration="12168000" />
+      <workItem from="1679878121007" duration="12226000" />
     </task>
     <servers />
   </component>

+ 3 - 4
application/common.php

@@ -344,10 +344,9 @@ function pdfCurl($file_name)
     curl_setopt($ch, CURLOPT_URL, 'https://pdf.gyxqcdz.com/v1/pdf/upload');
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_POST, 1);
-    //curl_setopt($ch, CURLOPT_POSTFIELDS, 'file=@'.$file_name);
-   // var_dump( ['file'=>new \CURLFile(realpath($file_name))]);die();
-    //curl_setopt($ch, CURLOPT_POSTFIELDS, ['file'=>new \CURLFile(realpath($file_name))]);
-    curl_setopt($ch, CURLOPT_POSTFIELDS, ['file'=>new \CURLFile($file_name)]);
+    //curl_setopt($ch, CURLOPT_POSTFIELDS, 'file=@'.$file_name);// pdf demo
+    //curl_setopt($ch, CURLOPT_POSTFIELDS, ['file'=>new \CURLFile(realpath($file_name))]); // 本地服务器路径
+    curl_setopt($ch, CURLOPT_POSTFIELDS, ['file'=>new \CURLFile($file_name)]);// oss路径
     $headers = array();
 
 //    $headers[] = 'Content-Type: application/x-www-form-urlencoded';