MCPcopy Create free account
hub / github.com/kataras/iris / AddFile

Method AddFile

x/client/client.go:362–370  ·  view source on GitHub ↗

AddFile adds a local form file to the uploader with the given key.

(key, filename string)

Source from the content-addressed store, hash-verified

360
361// AddFile adds a local form file to the uploader with the given key.
362func (u *Uploader) AddFile(key, filename string) error {
363 source, err := os.Open(filename)
364 if err != nil {
365 return err
366 }
367 defer source.Close()
368
369 return u.AddFileSource(key, filename, source)
370}
371
372// Uploads sends local data to the server.
373func (u *Uploader) Upload(ctx context.Context, method, urlpath string, opts ...RequestOption) (*http.Response, error) {

Callers

nothing calls this directly

Calls 3

AddFileSourceMethod · 0.95
CloseMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected