If your file out code is above your original code snippet so you have something like:
https://play.golang.org/p/5MVxJamHy4c

Then one of the problems is the file pointer of "out" points to the end of your file not the beginning.

If you don't need the file on disk then something like the following should suffice:
https://play.golang.org/p/GbLdui4NsGK

    Regards
    Steve

On 16/08/2018 01:18, maks...@gmail.com wrote:
err = out.Close()
if err != nil {
fmt.Println(err)
}

When I add this code after the io.Copy line, it gives me this error (attached screenshot to the email). It says upload multipart failed, failed to compute body hashes, and file already closed. I moved both the file.Close() and out.Close() lines to be after the io.Copy but I still got the same error.

On Wednesday, August 15, 2018 at 10:00:23 AM UTC-7, Ingo Oeser wrote:

    You seem to ignore the error from out.Close()

    What is out.Close reporting after the io.Copy?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com <mailto:golang-nuts+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to