ftp上传失败

来源:8-7 后台商品图片的springmvc上传与富文本上传ftp服务器功能开发2

慕丝6586257

2019-06-27

老师您好,我这没有上传成功,之前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服务器,结束上传,上传结果:{}

图片描述

写回答

1回答

geelylucky

2019-06-28

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

它的顺序是这样的:

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

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

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

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


0
1
慕丝6586257
老师我删除了那行代码以后在upload文件夹有图片显示,但是ftpfile/img没有图片。这是什么原因
2019-06-28
共1条回复

从0开始 独立完成企业级Java电商网站服务端开发

前后端分离,数据库接口设计,架构设计,功能开发,上线运维

9476 学习 · 8804 问题

查看课程