
本文共 2149 字,大约阅读时间需要 7 分钟。
base64���MultiPartFile���������������
���������������������������������������������������������������������������������������������Base64���������������������������������(base64 String)���������������������������������������������Base64������������������Spring Boot������������MultiPartFile���������
���������������
���������������������������������
####������������ ���������������������������������������Base64���������������������������������������������������������������������������������MultiPartFile������������������������������������������������������������
#####������������
public static MultipartFile base64ToMultipart(String base64) { try { // ���Base64������������������������������ String[] baseStrs = base64.split(","); // ������������������������������������ BASE64Decoder decoder = new BASE64Decoder(); byte[] decodedBytes = decoder.decodeBuffer(baseStrs[1]); // ��������������������������������� Arrays.copy(decodedBytes, 0, byte[0], 0, decodedBytes.length); return new BASE64DecodedMultipartFile(decodedBytes, baseStrs[0]); } catch (IOException e) { e.printStackTrace(); return null; }}
#####���������
####������������ ���������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������Base64���������������������������
发表评论
最新留言
关于作者
