Skip to content

is it possible axios file upload #243

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

Closed
guhyeon opened this issue Apr 21, 2021 · 0 comments · Fixed by #245
Closed

is it possible axios file upload #243

guhyeon opened this issue Apr 21, 2021 · 0 comments · Fixed by #245

Comments

@guhyeon
Copy link
Contributor

guhyeon commented Apr 21, 2021

swagger is well,
and uploading file has been successed manually.
but it is failed with generated function.

generated function

  uploadPost = (data: { file?: File }, params: RequestParams = {}) =>
    this.request<UploadAttachFileResponse, void>({
      path: `/api/file/upload`,
      method: "POST",
      body: data,
      type: ContentType.FormData,
      ...params,
    });

manual successed code

 const form = new FormData();
    form.append('file', e.target.files[0]);
    const response = await axios.post(
      '/api/file/upload',
      form
    );
@js2me js2me linked a pull request Apr 23, 2021 that will close this issue
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 a pull request may close this issue.

1 participant