danielgtaylor/huma

Accessing file name and file size in `multipart/form-data` request

Closed this issue · 1 comments

amsal commented

I was just trying out Feature: handling files from multipart/form-data request . It seems it doesn't currently export file name and size from the multipart header, or it could be changed to access the multipart file header directly.

// formdata.go
type FormFile struct {
	multipart.File
	ContentType string // Content-Type as declared in the multipart form field, or detected when parsing request as fallback
	IsSet       bool   // Indicates whether content was received when working with optional files

        Filename string
        Size int64
        // FileHeader *multipart.FileHeader // access file header directly?
}

@lsdch FYI