You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As we all know multipart/form-data generally can holds multiple files with same key. For example:
curl --location 'http://localhost:8088/v1/upload' \
--form 'files=@"/Users/username/test_0.txt"' \
--form 'files=@"/Users/username/test_1.txt"' \
--form 'desc="this is the sample"'
Then can be retrieved
files:=request.MultipartForm.File["files"] // This type is []*multipart.FileHeader
Existed
According to the source code in data_source.go line 779, we can see the FormData struct have addFiles function but it only takes the first element of the MultipartForm file arrays. See below:
// AddFiles adds the multipart form files to datafunc (d*FormData) AddFiles(filesMapmap[string][]*multipart.FileHeader) {
forkey, files:=rangefilesMap {
iflen(files) !=0 {
d.AddFile(key, files[0])
}
}
}
Expected
gookit/validate should hold these multiple files even the form-data key is same so that we can validate it correctly and can get the "safeData" which is a slice of multipart files
The text was updated successfully, but these errors were encountered:
Background
As we all know
multipart/form-data
generally can holds multiple files with same key. For example:Then can be retrieved
Existed
According to the source code in
data_source.go
line 779, we can see the FormData struct haveaddFiles
function but it only takes the first element of the MultipartForm file arrays. See below:Expected
gookit/validate should hold these multiple files even the form-data key is same so that we can validate it correctly and can get the "safeData" which is a slice of multipart files
The text was updated successfully, but these errors were encountered: