Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block omerkaya1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
omerkaya1 / post_large_file.go
Created Aug 16, 2019
Post a large file using io.Pipe() so that we don't need to read the whole file into memory
View post_large_file.go
func (c *ClientImpl) PostLargeFile(reader io.ReadCloser, formParams map[string]string) (io.ReadCloser, error) {
r, w := io.Pipe()
writer := multipart.NewWriter(w)
defer r.Close()
go func() {
defer w.Close()
defer reader.Close()
for key, val := range formParams {
You can’t perform that action at this time.