Java 当我上传一个现有的图像时,我得到了500个错误

Java 当我上传一个现有的图像时,我得到了500个错误,java,image,apache,jsp,servlets,Java,Image,Apache,Jsp,Servlets,我无法使用servlet将图像上载到我的数据库,我得到以下错误 HTTP Status 500 - troubleshoot.png (No such file or directory) type Exception report message troubleshoot.png (No such file or directory) description The server encountered an internal error that prevented it from

我无法使用servlet将图像上载到我的数据库,我得到以下错误

HTTP Status 500 - troubleshoot.png (No such file or directory)

type Exception report
message troubleshoot.png (No such file or directory)   
description The server encountered an internal error that prevented it from fulfilling this request.
exception java.io.FileNotFoundException: troubleshoot.png (No such file or directory)
java.io.FileInputStream.open(Native Method)
java.io.FileInputStream.<init>(FileInputStream.java:146)
ActionObject.Input.doGet(Input.java:54)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.47 logs.
我的web.xml文件包含以下内容:

<context-param>
      <param-name>tempfile.dir</param-name>
      <param-value>tmpfiles</param-value>
</context-param>

如果这是您的实际代码,那么您在输入中有2个type属性field@singhakash修正了,同样的错误。你试过上传其他的吗image@divinediu您是否已解决问题,发布表单代码?仍然无法上载图像
<context-param>
      <param-name>tempfile.dir</param-name>
      <param-value>tmpfiles</param-value>
</context-param>
 st.setPic(new FileInputStream(new File(request.getParameter("photo"))));