在linux上面使用springboot的上传文件的功能的时候,引起下面的异常:
写道
org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.6561926259726375802.9096/work/Tomcat/localhost/ROOT] is not valid
原因是:springboot启动之后会在 /tmp 目录创建文件夹等内容,上传文件夹在那里是不存在的 。
解决方案:在配置文件中添加上传文件的临时目录:
spring:
servlet:
multipart:
enabled: true
location: /hello/tempuploadfiles
servlet:
multipart:
enabled: true
location: /hello/tempuploadfiles
或者在启动参数上面添加JVM的参数指定临时文件夹:
-Djava.io.tmpdir=temp
参考资料:
2、https://blog.csdn.net/llibin1024530411/article/details/79474953
相关推荐
错误spring boot上传文件错误The temporary upload location [/tmp/tomcat.******/work/Tomcat/localhost/ROOT] is not valid
1、在上传文件前请在计算机C盘新建一个名为“upload”的文件夹,否则会出现如下异常:java.io.IOException: The temporary upload location [C:\upload] is not valid 2、请不要使用360安全浏览器演示本功能,否则会...
1、在上传文件前请在计算机C盘新建一个名为“upload”的文件夹,否则会出现如下异常:java.io.IOException: The temporary upload location [C:\upload] is not valid 2、请不要使用360安全浏览器演示本功能,否则会...
@Insert("CREATE TEMPORARY TABLE IF NOT EXISTS temp_table (id INT PRIMARY KEY, name VARCHAR(255))") void createTempTable(); @Select("SELECT * FROM temp_table") List<TempTable> selectFromTempTable...
2046: Options not valid or not consistent.** - **含义**:选项无效或不一致。 - **解决方案**:检查选项的有效性和一致性。 **45. 2047: Persistence not valid.** - **含义**:持久性设置无效。 - **解决方案*...
The primary focus is on understanding the differences and similarities in how these systems manage file systems, user accounts, and configurations. #### Directory Mappings Each Unix variant handles...
- **How a Servlet Works**: When a request is sent to a servlet, the servlet container creates a new instance of the servlet if one does not already exist. The `init()` method initializes the servlet, ...
If the -A option is exercised, the files are not copied to the <Windows>\INF directory. Refer to Section 4 for more information. ************************************************************ * 4...
- **CMEERROR:113 - Roaming not allowed in this location area**:在此位置区域不允许漫游。 - **CMEERROR:126 - Operation temporary not allowed**:操作暂时不允许。 - **CMEERROR:132 - Service operation not...
- **Problem**: When using temporary variables, it is easy to overlook the need to free their memory. - **Solution**: Manage temporary variables carefully. Ensure that their scope is limited and that ...
- **Purpose:** Ensuring that the default state of a value type is valid can prevent errors. - **Example:** Define a `PersonId` struct that uses 0 as the default value. **Item 20: Prefer Immutable ...
集合了 所有的 Unix命令大全 ...telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss ... 各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ ... 命令和参数之间必需用空格隔...
### 12c 新特性:Temporary Undo #### 一、Temporary Undo 概念与优势 在Oracle 12c版本中引入了一项重要的新特性——Temporary Undo,这项技术旨在优化临时表的操作性能,并减少对Redo日志的空间占用。传统的临时...
- **临时性 (Temporary)**:每个项目都有明确的开始和结束时间,这意味着项目团队是一次性的组织结构。 - **独特性 (Uniqueness)**:每个项目都是独一无二的,其产品或服务都具有一定的创新性和特殊性。 - **渐进...
- This indicates that the document is focused on professionals involved in the masonry trade, which involves the use of bricks, stones, and other similar materials for building structures. ...
- **例句:**The act of cruelty towards animals is an abomination. 25. **Aboriginal adj. Primitive; unsophisticated.** - **词目:Aboriginal** - **释义:**原始的;未开化的。 - **例句:**The ...
15. **NOT ENOUGH TEMPORARY OPERATOR STACK SPACE**:临时操作符栈空间不足。可能是因为模型过于复杂,需要简化或优化。 16. **NO RELATIONAL OPERATOR FOUND**:未找到关系运算符。在约束或目标函数中,确保使用...
20. **Temporary failure**:暂时性的问题,如临时的网络拥堵或设备故障。 21. **Switching equipment congestion**:交换设备负荷过重,无法处理更多呼叫。 22. **Access information discarded**:接入信息丢失或...
#### ORA-00033: Current undo tablespace is not valid - **描述**:当前撤销表空间无效。 - **解决方法**:检查撤销表空间的状态,并采取措施恢复其有效性。 #### ORA-00034: Unable to open current PL/SQL undo...
The only source of any storage location information is the sysindexes table, which keeps track of the address of the root page for every index, and the first IAM page for the index or table....