高拍仪上传图片到服务器

现在使用高拍仪是将图片保存到本地的,如果想直接上传服务器,请问怎么做,哪位大神能否解答一下?

在服务器上同一个位置建一个同名的文件夹,然后你打包上去的时候就会存在那里

//上传图片====================================
function getImg(imgStr, sfzjh) {
    jQuery.ajax({
        type : "POST",
        url : "${ctx}/xsbd/bdJbxx/generateImage",
        data : {
            imgStr : imgStr,
            sfzjh : sfzjh
        },
        dataType : 'json',
        async : false,
        success : function(result) {
            console.log(result);
        }
    });
}


    @ResponseBody
@RequestMapping(value = "generateImage")
public String generateImage(@RequestParam("imgStr") String imgStr,@RequestParam("sfzjh") String sfzjh,HttpServletRequest request)
{
    String imgFilePath =request.getSession().getServletContext().getRealPath("/") + "upload" + "/images/";
    File uploadDir = new File(imgFilePath);
    if (!uploadDir.exists()) {
        uploadDir.mkdirs();
    }
    imgFilePath += sfzjh+".jpg";
    boolean ret=true;
    Map<String,Object> map = new HashMap<String, Object>();
    if(imgStr==null)
    {
        ret= false;
        map.put("ret", ret);
        return JsonMapper.toJsonString(map);
    }
    BASE64Decoder decoder = new BASE64Decoder();
    try {
        byte[] bytes = decoder.decodeBuffer(imgStr);
        for (int i = 0; i < bytes.length; ++i)
        {
            if (bytes[i] < 0)// 调整异常数据
            {
                bytes[i] += 256;
            }
        }
        // 生成jpeg图片
        OutputStream out = new FileOutputStream(imgFilePath);
        out.write(bytes);
        out.flush();
        out.close();
    } catch (IOException e) {
        e.printStackTrace();
        map.put("ret", ret);
        return JsonMapper.toJsonString(map);
    }
    return JsonMapper.toJsonString(map);
}

}