博客
关于我
bootstrap+springMvc 文件上传
阅读量:120 次
发布时间:2019-02-26

本文共 1731 字,大约阅读时间需要 5 分钟。

??????????

1. ?????????

?????????????????????????????

  • ?????JS?

    ????????????JS?????????????????????????????????????

  • XML??????

    ????????????????????????????????????????????????????????

  • JSP????

    ?JSP???????????????????????

    • ?????????Excel????????????????
    • ????????????????????????
    • ????????Bootstrap??????UI??????????????????
    • ??????????????????????????????
  • JS???????

    ?JS????????????????????

    • ????????
    • ????????
    • ????????
    • ??????????
    • ??????????
  • 2. ??????

    ???????????????????????????

  • ??????

    ??MultipartHttpServletRequest?????????????request.getParameter???

    if (request instanceof MultipartHttpServletRequest) {    multipartRequest = (MultipartHttpServletRequest) request;    MultipartFile file = multipartRequest.getFile("file");
  • ???????????

    ????????????????????????????????

    String uploadFilePath = request.getSession().getServletContext().getRealPath("/uploadFile/");File myPath = new File(uploadFilePath);if (!myPath.exists()) {    myPath.mkdir();}
  • ?????????

    ???????????????????????

    String fileName = file.getOriginalFilename();String filePath = uploadFilePath + File.separator + fileName;File outputFile = new File(filePath);FileOutputStream fs = new FileOutputStream(outputFile);byte[] buffer = new byte[len];int byteread = 0;while ((byteread = inputStream.read(buffer)) != -1) {    fs.write(buffer, 0, byteread);    fs.flush();}fs.close();
  • ??????

    ?????????????????????????????????

    Map
    result = new HashMap<>();result.put("success", "true");result.put("msg", "???????");return new ModelAndView("jsonView", result);
  • 3. ???????

    ????????????????????????????????????????

  • ??????

    • ?????????????
    • ????????????
    • ????????????
  • ????????

    • ????????????
    • ??????????
    • ???????????
  • ????

    • ?????????????????????
    • ??????????
  • ??????????????????????????????

    转载地址:http://tssu.baihongyu.com/

    你可能感兴趣的文章
    Plotly:如何使用 updatemenus 更新一个特定的跟踪?
    查看>>
    Plotly:如何使用长格式或宽格式的 pandas 数据框制作线图?
    查看>>
    Plotly:如何向烛台图添加交易量
    查看>>
    Plotly:如何在 plotly express 中找到趋势线的系数?
    查看>>
    Plotly:如何在桑基图中设置节点位置?
    查看>>
    Plotly:如何处理重叠的颜色条和图例?
    查看>>
    Plotly:如何手动设置 plotly express 散点图中点的颜色?
    查看>>
    Plotly:如何结合 make_subplots() 和 ff.create_distplot()?
    查看>>
    Plotly:如何绘制累积的“步骤“;直方图?
    查看>>
    Quartz进一步学习与使用
    查看>>
    Plotly条形图-根据正/负值更改颜色-python
    查看>>
    PLSQL developer12安装图解
    查看>>
    PLSQL Developer调试 存储过程和触发器
    查看>>
    PLSQL window操作
    查看>>
    plsql 存储过程 测试
    查看>>
    plsql 安装后database下拉没有东西
    查看>>
    PLSQL_Oracle PLSQL内置函数大全(概念)
    查看>>
    PLSQL_案例优化系列_体验逻辑结构如何影响SQL优化(案例3)
    查看>>
    PLSQL中INDEX BY TABLE的 DELETE操作
    查看>>
    plsql学习笔记---plsql相关概念,以及基础结构
    查看>>