Skip to content

上传文件出现: The temporary upload location is not valid. #1320

Closed
@Royyu1215

Description

@Royyu1215
版本号:2.1.0 - 2.2.0 均有出现
问题描述: 因linux 服务器 定时清除临时文件夹导致的上传服务报错 .centos 服务器部署超过10天,上传文件 报错:The temporary upload location is not valid.建议在启动的时候用bean指定生成临时文件夹.
截图&代码:

org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.6239989728636105816.19530/work/Tomcat/localhost/ROOT] is not valid

友情提示: 未按格式要求发帖,会直接删掉。

Activity

zhangdaiscott

zhangdaiscott commented on Jun 16, 2020

@zhangdaiscott
Member

prod配置文件中加入以下代码,以及需要发布到linux系统的时候

server:
    tomcat:
        #修改tomcat临时文件生成位置,避免被linux自动回收机制回收
        #参考系统centos7.4,文件/usr/lib/tmpfiles.d/tmp.conf
        basedir: /opt/jeecg-boot/tomcat
Sean-214

Sean-214 commented on Jun 19, 2020

@Sean-214
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zhangdaiscott@Sean-214@Royyu1215

        Issue actions

          上传文件出现: The temporary upload location is not valid. · Issue #1320 · jeecgboot/JeecgBoot