Re: [go-nuts] File transfer,but file size is zero

2017-02-07 Thread Robert Hsiung
Hi Konstantin Khomoutov: Thanks so much for your great support. It works. BR Robert 2017-02-07 18:24 GMT+08:00 Konstantin Khomoutov < flatw...@users.sourceforge.net>: > On Tue, 7 Feb 2017 02:01:51 -0800 (PST) > Robert Hsiung wrote: > > > I tried to upload file via SFTP,but the file size

Re: [go-nuts] File transfer,but file size is zero

2017-02-07 Thread Robert Hsiung
HI Jesse McNelis: It works. Thanks so much for your great support. BR Robert 2017-02-07 18:12 GMT+08:00 Jesse McNelis : > On Tue, Feb 7, 2017 at 9:01 PM, Robert Hsiung wrote: > > Hi all: > > I tried to upload file via SFTP,but the file size is zero when it is > > done.Any suggestions? T

Re: [go-nuts] File transfer,but file size is zero

2017-02-07 Thread Konstantin Khomoutov
On Tue, 7 Feb 2017 02:01:51 -0800 (PST) Robert Hsiung wrote: > I tried to upload file via SFTP,but the file size is zero when it > is done.Any suggestions? Thanks so much. [...] > srcFile, err := os.Open("F:/NCA/20161027-1.csv") [...] > dstFile, err := server.Create("/root/20161027-

Re: [go-nuts] File transfer,but file size is zero

2017-02-07 Thread Jesse McNelis
On Tue, Feb 7, 2017 at 9:01 PM, Robert Hsiung wrote: > Hi all: > I tried to upload file via SFTP,but the file size is zero when it is > done.Any suggestions? Thanks so much. > // Copy the file > > dstFile.WriteTo(srcFile) > > } > You're writing the empty destination file to the srcFil

[go-nuts] File transfer,but file size is zero

2017-02-07 Thread Robert Hsiung
Hi all: I tried to upload file via SFTP,but the file size is zero when it is done.Any suggestions? Thanks so much. //sftp upload package main import ( "fmt" "os" "github.com/pkg/sftp" "golang.org/x/crypto/ssh" ) func main() { c := &ssh.ClientConfig{ U