swag icon indicating copy to clipboard operation
swag copied to clipboard

upload multi file is wrong

Open ghost opened this issue 4 years ago • 6 comments

upload multi file is wrong


// @Summary 多文件上传
// @Security ApiKeyAuth
// @Description | 参数 | 说明 |备注|
// @Description | :-----: | :----: | :----: |
// @accept x-www-form-urlencoded
// @Tags  admin
// @version 1.0
// @Param file formData []file true "文件" collectionFormat(multi)
// @success 200 object utils.JSONResult{} "成功"
// @Router /admin/v1/upload/multi [POST]

2021/01/08 11:34:52 ParseComment error in file app/http/controllers/admins/upload_controller.go :file is not supported array type for formData


ghost avatar Jan 08 '21 03:01 ghost

If you made a variable var files []file somewhere this file does your code still compile :) .

ubogdan avatar Feb 05 '21 10:02 ubogdan

Is there a solution to this yet?

fr3fou avatar Jul 30 '21 13:07 fr3fou

I also stumbled upon the same problem. Is there a solution for this?

padurean avatar Jun 13 '22 09:06 padurean

What's the current status of this feature? #1332 is merged but []file does nothing different than file or I couldn't manage to make it work in my local machine. Any change to update documentation, I would appreciate if anyone adds an example under /example dir

MuhammedOzdogan avatar Sep 29 '23 14:09 MuhammedOzdogan

We are also wondering what the status of this issue is.

We have APIs for users to upload multiple files, but only a single file can be selected from the swagger web interface.

If there is no solution for this issue, you can at least explain what the problem is and encourage a developer to solve it.

example swagger docs:

// .......................
// @Tags Attachment
// @Accept  multipart/form-data
// @Produce  json
// @Security BearerAuth
// @Param files formData file true "....."
// @Param is_private query string true "..."
// @Param folder query string true "..."
// @Success 200 {array} models.AWSContent "...."

SeanTolstoyevski avatar Mar 01 '24 10:03 SeanTolstoyevski