| | |
| | | if (!uploadDir.isDirectory()) { |
| | | uploadDir.mkdir(); |
| | | } |
| | | log.info("uploadDto:" + uploadDto.getBase64Str()); |
| | | BASE64Decoder decoder = new BASE64Decoder(); |
| | | byte[] bytes = new byte[0]; |
| | | try { |
| | |
| | | if (bytes.length > maxSize) { |
| | | return AjaxResult.buildFailInstance("上传文件大小超过限制"); |
| | | } |
| | | String newFileName = UUIDUtil.getRandomID() + UUIDUtil.getRandomID() + ".jpg"; |
| | | String newFileName = UUIDUtil.getRandomID() + UUIDUtil.getRandomID() + ".png"; |
| | | File uploadedFile = new File(savePath, newFileName); |
| | | try { |
| | | FileCopyUtils.copy(bytes, uploadedFile); |