Skip to content

🐛 [BUG] - uploadFiles() cannot upload image files as it is #58

@bentshrimp

Description

@bentshrimp

Browsers

Chrome

OS

Linux

Description

uploadFiles() has four steps

  1. get the branch data including current commit hash
  2. add files into the tree
  3. create a new commit
  4. update the branch

At the second step, tree parameter is supposed to get different mode depend on the file type.
두번째 단계에서, tree 매개변수는 파일의 유형에 다라 다른 mode 값을 가져야 합니다.

Reasons

      // add files into the tree
      const tree = await octokit.rest.git.createTree({
        owner: userName,
        repo: repoName,
        base_tree: baseTree,
        tree: files.map((file) => ({
          path: file.path,
          content: file.content,
          mode: '100644',
        })),
      });

It is a problem that when image file is added, the file goes broken.
예를 들면 이미지 파일을 올리면, 파일이 깨지는 문제가 있습니다.
We should fix it so that it can add any types of files.
어떤 유형의 파일이든 추가할 수 있도록 고쳐야 합니다.

Reproduction URL

localhost:8080/

Reproduction Steps

1. Add a function that check if file is image
이미지 파일인지 확인하는 함수를 만든다.
2. Figure out how to add image file as it is. NOT AS STRING.
어떻게 이미지 파일을 있는 그대로 올릴지 알아낸다. 문자열로가 아니라.

Solutions

No response

Screenshots

![DESCRIPTION](LINK.png)

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions