Commit 301c32d8 authored by fangxinjiang's avatar fangxinjiang

电子印章代码附件上传到税友-fxj

parent c2edff36
......@@ -15,6 +15,8 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.Files;
import java.util.Base64;
/**
* @Author fxj
......@@ -46,7 +48,9 @@ public class ExcelToImage {
String key = System.currentTimeMillis() + file.getName();
// TODO - shuiyou
String url = socialFriendConfig.uploadPng(restTemplate, key, file.toString(), backLog);
byte[] fileContent = Files.readAllBytes(file.toPath());
String base64String = Base64.getEncoder().encodeToString(fileContent);
String url = socialFriendConfig.uploadPng(restTemplate, key, base64String, backLog);
return R.ok(url);
}
} catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment