Skip to content

[Error] 홍세환 / 2022-01-20 #242

Description

@HongSehwan

어떤 에러인가요?

  • 이미지 업로드시 변경된 이미지 저장 에러
  • S3 bucket 엑세스 키 찾기 에러

에러 메시지

변경된 이미지가 마이페이지 적용되지 않음

에러 핸들링 방법

  • S3 bucket을 이용한 이미지 업로드시 (POST, PATCH) fromdata를 사용해 서버로 전송
  • formdata 사용시는 항상 아래와 같은 형식으로 axios 사용
const formData = new FormData();
            formData.append('nickname', nickname);
            formData.append('password', password);
            formData.append('img', image);

            axios
                .patch(`${process.env.REACT_APP_SERVER_URL}/users/mypage`, formData,
                    {
                        headers: {
                            'Content-Type': 'multipart/form-data'
                        }
                    }
                )
  • 엑세스 키 설정
AWS CLI를 사용하는 경우 다음 명령을 실행하여 저장된 액세스 키를 나열합니다.

$ aws configure list

또한 get-caller-identity AWS CLI 명령을 실행하여 API를 호출하기 위해 사용 중인 IAM 자격 증명에 대한 세부 정보를 가져올 수 있습니다.

$ aws sts get-caller-identity

에러 핸들링을 위해 참고한 레퍼런스 링크

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Err에러, 버그

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions