mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 12:13:24 +09:00
imgService 수정
This commit is contained in:
@@ -2,6 +2,7 @@ package com.no1.wms.mypage;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
@@ -19,15 +20,18 @@ public class ImgService {
|
|||||||
|
|
||||||
String storePathString = "";
|
String storePathString = "";
|
||||||
try {
|
try {
|
||||||
|
//대안1
|
||||||
|
|
||||||
|
//InputStream resource = getClass().getResourceAsStream("/static/img/mypage/profile");
|
||||||
|
|
||||||
|
|
||||||
|
//대안2
|
||||||
|
|
||||||
|
//InputStream resource = getClass().getClassLoader().getResourceAsStream("static/img/mypage/profile");
|
||||||
|
|
||||||
|
//기존
|
||||||
ClassPathResource resource = new ClassPathResource("/static/img/mypage/profile");
|
ClassPathResource resource = new ClassPathResource("/static/img/mypage/profile");
|
||||||
storePathString = resource.getFile().getAbsolutePath();
|
storePathString = resource.getFile().getAbsolutePath();
|
||||||
//storePathString = System.getProperty("user.dir") + "/src/main/resources/static/img/mypage/profile";
|
|
||||||
//System.out.println("storePathString : " + storePathString);
|
|
||||||
//String path = ResourceUtils.getFile("classpath:static/img/mypage/profile/").toPath().toString();
|
|
||||||
//storePathString = path;
|
|
||||||
|
|
||||||
//System.out.println("storePathString : " + storePathString);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
Reference in New Issue
Block a user