AddFile adds a local form file to the uploader with the given key.
(key, filename string)
| 360 | |
| 361 | // AddFile adds a local form file to the uploader with the given key. |
| 362 | func (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. |
| 373 | func (u *Uploader) Upload(ctx context.Context, method, urlpath string, opts ...RequestOption) (*http.Response, error) { |
nothing calls this directly
no test coverage detected