• servlet上传文件报错(一)


    1、具体报错如下:

    org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. D:MyEclipseworkspaceFileUploadWebRootuploadupload_920ae854_8fc7_426e_9db7_ebfdd77f469b_00000002.tmp (系统找不到指定的路径。)
    	at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:351)
    	at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:115)
    	at com.you.file.servlet.FileUploadServlet.doPost(FileUploadServlet.java:44)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
    	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    	at java.lang.Thread.run(Thread.java:619)
    Caused by: java.io.FileNotFoundException: D:MyEclipseworkspaceFileUploadWebRootuploadupload_920ae854_8fc7_426e_9db7_ebfdd77f469b_00000002.tmp (系统找不到指定的路径。)
    	at java.io.FileOutputStream.open(Native Method)
    	at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
    	at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
    	at org.apache.commons.io.output.DeferredFileOutputStream.thresholdReached(DeferredFileOutputStream.java:178)
    	at org.apache.commons.io.output.ThresholdingOutputStream.checkThreshold(ThresholdingOutputStream.java:224)
    	at org.apache.commons.io.output.ThresholdingOutputStream.write(ThresholdingOutputStream.java:128)
    	at org.apache.commons.fileupload.util.Streams.copy(Streams.java:107)
    	at org.apache.commons.fileupload.util.Streams.copy(Streams.java:70)
    	at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:347)
    	... 20 more


    2、错误原因

         在“D:MyEclipseworkspaceFileUploadWebRoot”目录下没有upload文件夹


    3、解决办法

         在“D:MyEclipseworkspaceFileUploadWebRoot”下新建文件夹“upload”

        

  • 相关阅读:
    codeforces 1065F Up and Down the Tree
    初探莫比乌斯反演
    IOI2008 island
    miller——rabin判断素数
    NOIP2018游记
    NP是什么意思?
    word2016如何英汉互译
    2.1数字图像化
    Windows程序内部运行机制
    2.2图像灰度直方图
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13315175.html
Copyright © 2020-2023  润新知