Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR : there is no uploaded file associated with the given key #1

Closed
minpeter opened this issue Oct 20, 2022 · 3 comments · Fixed by #2
Closed

ERROR : there is no uploaded file associated with the given key #1

minpeter opened this issue Oct 20, 2022 · 3 comments · Fixed by #2
Assignees
Labels
bug Something isn't working

Comments

@minpeter
Copy link
Member

github.com/ananjaemin/tempfiles/src/pages/main/index.tsx 파일에서 axios 요청을 보낼때 file 필드에 실제 바이트 데이터가 아닌 filename string으로 요청을 날리는 문제

@minpeter
Copy link
Member Author

    if (fileProps.name != '' && fileProps.size != '') {
      const formdata = new FormData();
      formdata.append('file', fileProps.name);
      await axios({
        method: 'post',
        url: 'https://tfb.minpeter.cf/upload',
        data: formdata,
        headers: {
          'Content-Type': 'multipart/form-data',
        },
      })

핵심 문제 코드

@minpeter minpeter added the bug Something isn't working label Oct 20, 2022
@minpeter minpeter self-assigned this Oct 20, 2022
@minpeter
Copy link
Member Author

bugfix-1 브랜치에서 fix

@minpeter
Copy link
Member Author

  1. 이전 커밋 내역에 존재하는 fileProps.files 필드 복원
  2. 변수명을 files에서 좀 더 알맞는 fileData로 변경

@minpeter minpeter linked a pull request Oct 20, 2022 that will close this issue
ananjaemin added a commit that referenced this issue Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant