wupengfei hace 2 años
padre
commit
7e31c9c2f8
Se han modificado 2 ficheros con 4 adiciones y 2 borrados
  1. 2 1
      .idea/workspace.xml
  2. 2 1
      application/common.php

+ 2 - 1
.idea/workspace.xml

@@ -2,7 +2,8 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
-      <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$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />

+ 2 - 1
application/common.php

@@ -345,7 +345,8 @@ function pdfCurl($file_name)
     curl_setopt($ch, CURLOPT_URL, 'http://101.132.128.55:9999/v1/pdf/upload');
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_POST, 1);
-    curl_setopt($ch, CURLOPT_POSTFIELDS, 'file=@'.$file_name);
+//    curl_setopt($ch, CURLOPT_POSTFIELDS, 'file=@'.$file_name);
+    curl_setopt($ch, CURLOPT_POSTFIELDS, ['file'=>new \CURLFile(realpath($file_name))]);
     $headers = array();
 
     $headers[] = 'Content-Type: application/x-www-form-urlencoded';