博客
关于我
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/

    你可能感兴趣的文章
    python列表去重复后按照顺序_从包含不可共元素的Python列表中删除重复元素,同时保留顺序?...
    查看>>
    python列表前几个_python之列表
    查看>>
    python列表元组
    查看>>
    Python列表/元组/字典和集合使用
    查看>>
    python列表 行列选择_python_pandas_dataframe_行列选择_切片操作
    查看>>
    python列表
    查看>>
    python列出当前目录、子目录和文件的脚本
    查看>>
    python+flask计算机毕业设计骨科门诊患者档案管理系统(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校体测管理系统的设计与实现(程序+开题+论文)
    查看>>
    Python切片对象和__getitem__
    查看>>
    python+flask计算机毕业设计高校体育赛事系统(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校体育运动会比赛系统(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校危化品管理系统(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校教学档案管理系统(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校教学督导平台(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校数字化迎新系统(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校校内景点平台(程序+开题+论文)
    查看>>
    python+flask计算机毕业设计高校校园线上跳蚤市场的系统设计(程序+开题+论文)
    查看>>
    Python图形处理
    查看>>
    python+flask计算机毕业设计高校物品使用互益平台的设计与实现(程序+开题+论文)
    查看>>