Dave, thanks for the reply!

That bit is OK... you are correct that it won't break out of the loop until 
io.EOF. It comes across the uploadfile part first and sets the variable 
accordingly. Then once, looped through all parts, it breaks the loop and I 
try to copy the file - wherein I run into the issue.

-Seth

On Friday, December 8, 2017 at 4:07:17 PM UTC-5, Dave Cheney wrote:
>
> I’ve never used the multipart reader, but looking at this piece of logic 
>
> var uploadFile *multipart.Part 
>     for { 
>         p, err := fr.NextPart() 
>         if err == io.EOF { 
>             break 
>         } 
>         if err != nil { 
>             log.Fatal(err) 
>         } 
>         if err != nil { 
>             log.Fatal(err) 
>         } 
>         if p.FormName() == "uploadfile" { 
>             uploadFile = p 
>             fmt.Println("UploadFile: ", uploadFile) 
>         } 
>     } 
>
> It seems to me that the loop will only exit when fr.NextPart returns 
> io.EOF ( all other cases will cause your program to exit). The example from 
> godoc has a suggestion for how to process the uploaded file 
> https://golang.org/pkg/mime/multipart/#example_NewReader

-- 
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