使用jsp,servlets将映像上传到mysql

时间:2017-01-02 11:49:37

标签: mysql jsp servlets

使用此代码将图像上传到mysql

        Part filePart = request.getPart("photo");
    if (filePart != null) {
        // prints out some information for debugging
        System.out.println(filePart.getName());
        System.out.println(filePart.getSize());
        System.out.println(filePart.getContentType());
      // obtains input stream of the upload file
        inputStream = filePart.getInputStream();
    }

编译给出错误

The method getPart(String) is undefined for the type HttpServletRequest

如何解决这个问题?

0 个答案:

没有答案