-
카테고리
-
세부 분야
풀스택
-
해결 여부
미해결
pdf view 기능 구축
22.05.06 13:58 작성 조회수 95
0
안녕하세요
제로초님, 기존 s3 연결 및 파일 업로드 알려주신 부분은
문제없이 잘 진행하였는데, 추가로 하고싶은 기능이 있어
질문드립니다.
s3에 업로드시에 aws에서 제공하는 location 주소를
iframe tag에 연결하면 바로 다운로드가 되더라구요.
그래서 해결 방법을 찾았는데, aws meta 데이터 형식을
content-Type : 'application/json' 으로
수정하면 다운로드가 되지 않더라구요. 이 방법은 제가
수동으로 진행한것이고, 혹시 upload시에 저렇게 셋팅할수 있는 방법이 있을까요?
답변을 작성해보세요.
0
![조현영님의 프로필](https://cdn.inflearn.com/wp-content/uploads/avatars/14793/5bbebf0cc0f37-bpfull.png?w=48)
조현영
지식공유자2022.05.06
storage: multerS3({ s3: s3, bucket: 'some-bucket', contentType: '여기', key: function (req, file, cb) { cb(null, Date.now().toString()) } })
이렇게 세팅할 수 있습니다.
![dhj100님의 프로필](https://cdn.inflearn.com/public/main/profile/default_profile.png?w=48)
dhj100
질문자2022.05.06
답변대로 적용했는데, 아래와 같은 Warning이 발생하네요.
Warning: connect.session() MemoryStore is not designed for a production environment, as it will leak memory, and will not scale past a single process
기존에는 Warning이 발생하지 않아서 검색해보니, 스택오버플로우에 RedisStore를 적용하라는
답변이 있어서 해당 내용 적용하면 될까요..?
![dhj100님의 프로필](https://cdn.inflearn.com/public/main/profile/default_profile.png?w=48)
dhj100
질문자2022.05.08
log 확인해보니 다른 에러가 발생하더라구요
contentType에는 undefined나 함수가 들어와야한다고 해서, 타입 맞추어주니
해결되었습니다! 감사합니다.
답변 1