Comments (5)
异常信息贴一下,可能是路径写错了。
from my-blog.
异常信息贴一下,可能是路径写错了。
异常信息:
java.io.IOException: 文件夹创建失败,路径为:\opt\deploy\upload
at com.site.blog.my.core.controller.admin.UploadController.upload(UploadController.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:215)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:142)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:998)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:901)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
...............
Constants.java 里的路径
package com.site.blog.my.core.config;
/**
* Created by 13 on 2019/5/24.
*/
public class Constants {
public final static String FILE_UPLOAD_DIC = "/opt/deploy/upload/";//上传文件的默认url前缀,根据部署设置自行修改
}
from my-blog.
那你现在服务器上有这些路径吗?/opt/deploy/upload/
from my-blog.
啊这,是要自己创建的吗?我去试试。
我一直以为这个 mkdir会自动给创建出来
from my-blog.
在服务器创建了文件夹以后是可以上传图片了,我想知道这个是为什么?
难道是服务器端的权限问题么?
from my-blog.
Related Issues (20)
- 发表博客上传图片失败提示undefined HOT 1
- 单元测试以及集成测试貌似没有。。。 HOT 1
- English version HOT 2
- 有没有部署的讲解,📮:[email protected] HOT 1
- 博客主页,在手机端右上角的菜单栏点不开 HOT 1
- 500 错误,项目本机运行正确 HOT 1
- 一个类文件问题 HOT 2
- 博客发布 HOT 1
- Webservice currently unavailable Error 500 HOT 1
- 登录时数据库链接失败
- .。。
- 友情链接update后再save,save会变成update HOT 2
- 你的个人博客不安全 HOT 2
- 二次开发请教
- 使用较高版本的SpringBoot会出现报错:boolean无法转换为org.springframework.boot.web.error.ErrorAttributeOptions HOT 2
- 有一个bug,展示端中根据Tag标签分类博客,点击后会显示所有文章,而不是该标签对应的博客列表,要改一下sql查询方法
- 添加博客 内容框 無法添加圖片
- 500报错
- 谢谢大佬的项目代码 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from my-blog.