프로필이미지업로드 수정

This commit is contained in:
Kana
2024-01-17 13:42:21 +09:00
parent 711bc207cd
commit ccb0c5fdfd

View File

@@ -19,19 +19,14 @@ public class ImgService {
String storePathString = ""; String storePathString = "";
try { try {
//장원형님 아이디어
ClassPathResource resource = new ClassPathResource("/static/img/mypage/profile"); ClassPathResource resource = new ClassPathResource("/static/img/mypage/profile");
storePathString = resource.getFile().getAbsolutePath(); storePathString = resource.getFile().getAbsolutePath();
//System.out.println("storePathString : " + storePathString);
//되는거
//storePathString = System.getProperty("user.dir") + "/src/main/resources/static/img/mypage/profile"; //storePathString = System.getProperty("user.dir") + "/src/main/resources/static/img/mypage/profile";
//System.out.println("storePathString : " + storePathString); //System.out.println("storePathString : " + storePathString);
//강사님 버전
//String path = ResourceUtils.getFile("classpath:static/img/mypage/profile/").toPath().toString(); //String path = ResourceUtils.getFile("classpath:static/img/mypage/profile/").toPath().toString();
//storePathString = path; //storePathString = path;
//System.out.println("storePathString : " + storePathString); //System.out.println("storePathString : " + storePathString);
} catch (Exception e) { } catch (Exception e) {