Hi all:
     I tried to Stor file  by ftp ,but show error as  "553 Could not create 
file". It is successful to use filezilla client,so ftp server is ok.
Please give me some suggestions. Thanks so much.

C:/Go/bin/go.exe build -i [F:/go/ftp_client]

Success: process exited with code 0.

F:/go/ftp_client/ftp_client.exe [F:/go/ftp_client]

553 Could not create file.

Success: process exited with code 0.



// ftp_client

package main


import (

    "fmt"

    "os"


    "github.com/jlaffaye/ftp"

)


func main() {

    c, err := ftp.Connect("192.168.44.129:21")

    if err != nil {

        fmt.Println(err)

    }

    err = c.Login("root", "74634265")

    if err != nil {

        fmt.Println(err)

    }

    //c.MakeDir("test")

    file, err := os.Open("F:/go/ftp_client/20161027-2.csv")

    if err != nil {

        fmt.Println(err)

    }

    defer file.Close()

    err = c.Stor("/root/", file)

    if err != nil {

        fmt.Println(err)

    }

    c.Quit()

}

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