请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

ftp上传失败

老师您好,我这没有上传成功,之前nginx配置跟老师视频一样的,没配置错误呀,现在创建的文件夹没有相关文件。不知道哪里出错了呢

[22:32:33.656][DEBUG][org.mybatis.spring.SqlSessionUtils][http-bio-8080-exec-6] Creating a new SqlSession
[22:32:33.670][DEBUG][org.mybatis.spring.SqlSessionUtils][http-bio-8080-exec-6] SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@75e2bdef] was not registered for synchronization because synchronization is not active
[22:32:34.026][DEBUG][o.m.s.t.SpringManagedTransaction][http-bio-8080-exec-6] JDBC Connection [jdbc:mysql://localhost:3306/mmall_learning?useSSL=false&useUnicode=true&characterEncoding=utf8, UserName=root@localhost, MySQL-AB JDBC Driver] will not be managed by Spring
[22:32:34.032][DEBUG][com.mmall.dao.UserMapper.checkUsername][http-bio-8080-exec-6] ==> Preparing: select count(1) from mmall_user where username = ?
[22:32:34.052][DEBUG][com.mmall.dao.UserMapper.checkUsername][http-bio-8080-exec-6] > Parameters: admin(String)
[22:32:34.068][DEBUG][com.mmall.dao.UserMapper.checkUsername][http-bio-8080-exec-6] < Total: 1
[22:32:34.070][DEBUG][org.mybatis.spring.SqlSessionUtils][http-bio-8080-exec-6] Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@75e2bdef]
[22:32:34.080][DEBUG][org.mybatis.spring.SqlSessionUtils][http-bio-8080-exec-6] Creating a new SqlSession
[22:32:34.080][DEBUG][org.mybatis.spring.SqlSessionUtils][http-bio-8080-exec-6] SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1930c398] was not registered for synchronization because synchronization is not active
[22:32:34.081][DEBUG][o.m.s.t.SpringManagedTransaction][http-bio-8080-exec-6] JDBC Connection [jdbc:mysql://localhost:3306/mmall_learning?useSSL=false&useUnicode=true&characterEncoding=utf8, UserName=root@localhost, MySQL-AB JDBC Driver] will not be managed by Spring
[22:32:34.081][DEBUG][com.mmall.dao.UserMapper.selectLogin][http-bio-8080-exec-6] ==> Preparing: SELECT id, username, password, email, phone, question, answer, role, create_time, update_time from mmall_user where username = ? and password = ?
[22:32:34.081][DEBUG][com.mmall.dao.UserMapper.selectLogin][http-bio-8080-exec-6] > Parameters: admin(String), D8F80B67499E434EA61ADAF6E6219BF2(String)
[22:32:34.086][DEBUG][com.mmall.dao.UserMapper.selectLogin][http-bio-8080-exec-6] < Total: 1
[22:32:34.086][DEBUG][org.mybatis.spring.SqlSessionUtils][http-bio-8080-exec-6] Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1930c398]
[22:33:00.955][INFO][com.mmall.service.impl.FileServiceImpl][http-bio-8080-exec-9] 开始上传文件,上传文件的文件名:boy.jpg,上传的路径:E:\apache-tomcat-7.0.75\webapps\ROOT\upload,新文件名:d7834756-68ee-402d-857d-b5b57ce231ad.jpg
[22:33:00.992][INFO][com.mmall.util.FTPUtil][http-bio-8080-exec-9] 开始连接ftp服务器
[22:33:01.017][INFO][com.mmall.util.FTPUtil][http-bio-8080-exec-9] 开始连接ftp服务器,结束上传,上传结果:{}

图片描述

正在回答 回答被采纳积分+3

1回答

geelylucky 2019-06-28 00:00:08

同学,代码里面有一个删除upload文件夹文件的代码,你可以先注释那行代码,然后你检查一下ftpfile/img里面有没有上传的图片。

它的顺序是这样的:

  1. 用户上传图片后把图片先写在upload文件夹

  2. 把upload的图片上传到ftp服务器

  3. 上传ftp服务器后,把upload的图片删除

  4. 代码里面有一个bug,无论有没有上传ftp成功,都会删除upload的图片


0 回复 有任何疑惑可以回复我~
  • 提问者 慕丝6586257 #1
    老师我删除了那行代码以后在upload文件夹有图片显示,但是ftpfile/img没有图片。这是什么原因
    回复 有任何疑惑可以回复我~ 2019-06-28 00:13:50

相似问题

登录后可查看更多问答,登录/注册

问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信