思路:前端對文件進(jìn)行壓縮處理,通過Ajax將處理的文件數(shù)據(jù)(二進(jìn)制數(shù)據(jù)進(jìn)行base64加密);后臺取出需要保存的文件二進(jìn)制數(shù)據(jù)(注意:去掉頭部不需要的數(shù)據(jù)部分)。然后對二進(jìn)制數(shù)據(jù)進(jìn)行保存,后續(xù)業(yè)務(wù)相關(guān)保存根據(jù)具體業(yè)務(wù)來處理 /壓縮文件上傳/ @RequestMapping(value =”/uploadFile”) @ResponseBody public Object uploadImg2(HttpServletRequest request) throws Exception { String fileFolder =”/loanPhoto”; String fileName = request.getParameter(“name”);//”tupian.jpeg”; Map
新聞熱點(diǎn)
疑難解答