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

Method AddFileSource

x/client/client.go:351–359  ·  view source on GitHub ↗

AddFileSource adds a form file to the uploader with the given key.

(key, filename string, source io.Reader)

Source from the content-addressed store, hash-verified

349
350// AddFileSource adds a form file to the uploader with the given key.
351func (u *Uploader) AddFileSource(key, filename string, source io.Reader) error {
352 f, err := u.Writer.CreateFormFile(key, filename)
353 if err != nil {
354 return err
355 }
356
357 _, err = io.Copy(f, source)
358 return err
359}
360
361// AddFile adds a local form file to the uploader with the given key.
362func (u *Uploader) AddFile(key, filename string) error {

Callers 1

AddFileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected