|
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
+import java.io.File;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
@@ -45,20 +46,12 @@ public class formDataUtils {
|
|
String randomUUID = UUID.randomUUID().toString();
|
|
String randomUUID = UUID.randomUUID().toString();
|
|
int index = originalFilename.lastIndexOf(".");
|
|
int index = originalFilename.lastIndexOf(".");
|
|
String exet = originalFilename.substring(index);
|
|
String exet = originalFilename.substring(index);
|
|
- String file1 = client.uploadFile(randomUUID + exet);
|
|
|
|
- return file1;
|
|
|
|
-
|
|
|
|
- /*Date date = new Date();
|
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd\\HH\\mm\\ss");
|
|
|
|
- String dateStr = sdf.format(date); // D:\\uploads\\20180824 String
|
|
|
|
- String filePath = "D:\\uploads\\" + dateStr;
|
|
|
|
|
|
+ String filePath = "/mnt/newdatadrive/data/custom/autodeploy/client/releasecode/mai/mai@beta@2020010900000000/tempImage/";
|
|
System.out.println("filePath=" + filePath);
|
|
System.out.println("filePath=" + filePath);
|
|
- File file2 = new File(filePath);
|
|
|
|
- if (!file2.exists()) {
|
|
|
|
- file2.mkdirs();
|
|
|
|
- }
|
|
|
|
filePath += "\\" + randomUUID + exet;
|
|
filePath += "\\" + randomUUID + exet;
|
|
System.out.println(filePath + "P");
|
|
System.out.println(filePath + "P");
|
|
- file.transferTo(new File(filePath));// ctrl+1*/
|
|
|
|
|
|
+ file.transferTo(new File(filePath));// ctrl+1
|
|
|
|
+ String file1 = client.uploadFile(filePath);
|
|
|
|
+ return file1;
|
|
}
|
|
}
|
|
}
|
|
}
|