Skip to content

Step6 - #145

Merged
javajigi merged 5 commits into
code-squad:daesoopfrom
daesoop:step6
Jan 22, 2019
Merged

Step6#145
javajigi merged 5 commits into
code-squad:daesoopfrom
daesoop:step6

Conversation

@daesoop

@daesoop daesoop commented Jan 21, 2019

Copy link
Copy Markdown

이슈에 글을 올렸을 때, 파일을 업로드 및, 다운로드를 할 수 있게끔 만들었습니다.
이번 작업을 하면서, 파일 업로드에 대해서 조금 이해하게 되었고, 많은 착오가 있었지만 많은 어려움 없이 해결이 되어 조금은 의아 합니다.
다운로드를 outputstream을 사용하여 해보려 노력했지만, 아직 부족한 관계로 다음 기회에 다시 도전해 보려합니다.
이번에 파일 업로드를 하면서 구글에서 많은 정보들을 찾았었는데, 파일 업로드, 다운로드 한 것도 뿌듯 하지만, 정보를 혼자서 찾아 만들었다는 것에 더욱 값진 기간이였던 것 같습니다.

@javajigi javajigi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

경로 설정 정보를 어떻게 관리하는지 추가학습해 보면 좋겠네요.

@Entity
public class Multipart extends AbstractEntity {
private static final Logger log = getLogger(Multipart.class);
private static final String UPLOAD_PATH = "C:\\Users\\User\\Documents\\workspace\\codesquad\\java-ims\\src\\main\\resources\\static\\fileUpload\\";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이와 같은 설정 정보를 하드코딩할 경우 서버에 배포했을 때 정상적으로 동작할까?
https://www.baeldung.com/spring-value-annotation 문서 참고해 설정 정보를 properties에서 관리한다.

파일 업로드 경로를 프로젝트 내 경로(src/main/resources/static과 같이)로 하지 말고 외부 경로로 설정한다.

@javajigi javajigi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정한 후 테스트 정상적으로 진행했나요?
코드 수정하면 테스트 철저하게 진행해 주세요.

private String saveName;

@Value("${value.from.file}")
private String uploadPath;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 설정이 정상적으로 동작하나?
의도한데로 동작하는지 값을 출력해 본다.

@javajigi
javajigi merged commit 65c4909 into code-squad:daesoop Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants