|
|
|
@ -15,6 +15,7 @@ import java.io.InputStream; |
|
|
|
import java.io.InputStreamReader; |
|
|
|
import java.net.HttpURLConnection; |
|
|
|
import java.net.URL; |
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
|
|
|
|
/** |
|
|
|
* 巡检报告上传服务(外部平台《巡检报告接口文档 v1.0.0》) |
|
|
|
@ -127,8 +128,9 @@ public class ReportUploadService { |
|
|
|
out.write(reportInfoJson.getBytes("UTF-8")); |
|
|
|
out.writeBytes("\r\n"); |
|
|
|
// file 字段 |
|
|
|
out.writeBytes("--" + boundary + "\r\n"); |
|
|
|
out.writeBytes("Content-Disposition: form-data; name=\"file\"; filename=\"" + fileName + "\"\r\n"); |
|
|
|
out.write(("--" + boundary + "\r\n").getBytes(StandardCharsets.UTF_8)); |
|
|
|
String fileHeader = "Content-Disposition: form-data; name=\"file\"; filename=\"" + fileName + "\"\r\n"; |
|
|
|
out.write(fileHeader.getBytes(StandardCharsets.UTF_8)); |
|
|
|
out.writeBytes("Content-Type: application/octet-stream\r\n\r\n"); |
|
|
|
try (InputStream in = new ByteArrayInputStream(fileBytes)) { |
|
|
|
byte[] buf = new byte[8192]; |
|
|
|
|