Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27f941768a | ||
|
|
63ae9e7433 |
@@ -359,7 +359,7 @@ public static String putImg(ServletContext servletContext,MultipartFile file,Str
|
||||
saveSql(realurl, towhere,fileName);
|
||||
}
|
||||
|
||||
if(servletContext != null) return "/getFile/"+rid;
|
||||
if(servletContext != null) return "/getImg/"+rid;
|
||||
else return realurl;
|
||||
}
|
||||
|
||||
@@ -452,7 +452,7 @@ public static String putImgAsName(ServletContext servletContext,MultipartFile fi
|
||||
saveSql(realurl, towhere,fileName);
|
||||
}
|
||||
|
||||
if(servletContext != null) return "/getFile/"+rid;
|
||||
if(servletContext != null) return "/getImg/"+rid;
|
||||
else return realurl;
|
||||
}
|
||||
|
||||
@@ -548,7 +548,7 @@ public static String putVideo(ServletContext servletContext,MultipartFile file,S
|
||||
saveSql(realurl, towhere,fileName);
|
||||
}
|
||||
|
||||
if(servletContext != null) return "/getFile/"+rid;
|
||||
if(servletContext != null) return "/getImg/"+rid;
|
||||
else return realurl;
|
||||
}
|
||||
|
||||
@@ -669,8 +669,8 @@ public static void saveSql(String realurl, String towhere, String saveName) {
|
||||
String msid = towhere.split("#")[1];
|
||||
String mstag = towhere.split("#")[2];
|
||||
|
||||
if(realurl.indexOf("/getFile/")==0) {
|
||||
realurl=realurl.replace("/getFile/", "");
|
||||
if(realurl.indexOf("/getImg/")==0) {
|
||||
realurl=realurl.replace("/getImg/", "");
|
||||
if(db.execSql("select * from savefile where id = '"+realurl+"'", null)>0){//已存在
|
||||
db.execUpdate("update savefile set mstab=?,msid=?,mstag=?,savename=? where id=?", new String[]{mstab.trim(),msid.trim(),mstag.trim(),realurl.trim(),saveName==null?"":saveName.trim()});
|
||||
}else{//不存在
|
||||
@@ -780,8 +780,8 @@ public static void delfile(ServletContext servletContext, String path) {
|
||||
if(path.indexOf(":") <= 0)
|
||||
path1 = "D:\\" + path;
|
||||
} else {
|
||||
if(path.indexOf("/getFile/")==0){
|
||||
String rid = path.replace("/getFile/", "");
|
||||
if(path.indexOf("/getImg/")==0){
|
||||
String rid = path.replace("/getImg/", "");
|
||||
DBUtil db = new DBUtil();
|
||||
List<Map<String, Object>> rs = db.execQuery("select * from savefile where id ="+rid, null);
|
||||
if(rs!=null&&rs.size()>0){
|
||||
@@ -828,8 +828,8 @@ public static void delFileForStr(ServletContext servletContext, String str) {
|
||||
if(path.indexOf(":") <= 0)
|
||||
path1 = "D:\\" + path;
|
||||
} else {
|
||||
if(path.indexOf("/getFile/")==0){
|
||||
String rid = path.replace("/getFile/", "");
|
||||
if(path.indexOf("/getImg/")==0){
|
||||
String rid = path.replace("/getImg/", "");
|
||||
List<Map<String, Object>> rs = db.execQuery("select * from savefile where id ="+rid, null);
|
||||
if(rs!=null&&rs.size()>0){
|
||||
oldpath=rs.get(0).get("realurl")+"";
|
||||
@@ -867,8 +867,8 @@ public static void intoSqlForStr(String str,String towhere,String saveName) {
|
||||
mstag = towhere.split("#")[2];
|
||||
|
||||
for (String path : imgs) {
|
||||
if(path.indexOf("/getFile/")==0){
|
||||
String rid = path.replace("/getFile/", "");
|
||||
if(path.indexOf("/getImg/")==0){
|
||||
String rid = path.replace("/getImg/", "");
|
||||
List<Map<String, Object>> rs = db.execQuery("select * from savefile where id ="+rid, null);
|
||||
if(rs!=null&&rs.size()>0){
|
||||
path=rs.get(0).get("realurl")+"";
|
||||
|
||||
Reference in New Issue
Block a user