MCPcopy
hub / github.com/gofiber/fiber / File

Method File

client/request.go:536–550  ·  view source on GitHub ↗

File returns the file associated with the given name. If no name was provided during addition, it attempts to match by the file's base name.

(name string)

Source from the content-addressed store, hash-verified

534// File returns the file associated with the given name.
535// If no name was provided during addition, it attempts to match by the file's base name.
536func (r *Request) File(name string) *File {
537 for _, v := range r.files {
538 switch v.name {
539 case "":
540 if filepath.Base(v.path) == name {
541 return v
542 }
543 case name:
544 return v
545 default:
546 continue
547 }
548 }
549 return nil
550}
551
552// Files returns all files added to the Request.
553//

Callers 2

Test_Request_FileFunction · 0.80

Calls

no outgoing calls

Tested by 2

Test_Request_FileFunction · 0.64