Git Product home page Git Product logo

ftp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ftp's Issues

Timeout on errors

If my user doesn't have write permissions, occurs this:

<cmd>
<code> 220
<message> (vsFTPd 2.3.5)
<cmd> USER xxxxxxxxxx
<code> 331
<message> Please specify the password.
<cmd> PASS yyyyyyyyyyyyyy
<code> 230
<message> Login successful.
<cmd> PASV
<code> 227
<message> Entering Passive Mode (127,0,0,1,39,156).
<cmd> STOR hola.go
<code> 550
<message> Permission denied.
<response> OK

And the program don't exits. How can I terminate the program if un error occurs, or after a timeout?

I tried to add this (after ftp.Stor("hola.go", b)):

if ftp.Code == 550 {
fmt.Println("error: permissions failure")
os.Exit(-1)
}

but it does not work.. :(

small fish ftp can't upload image !

i can't upload image into ftp
func Uper(w http.ResponseWriter , r _http.Request) {
ftp := new(ftp.FTP)
// debug default false
ftp.Debug = true
ftp.Connect(_ftp, 21)
// login
ftp.Login(*us, *ps)
if ftp.Code == 530 {
fmt.Println("error: login failure")
}

// pwd
ftp.Pwd()
fmt.Println("code:", ftp.Code, ", message:", ftp.Message)                   

// make dir
ftp.Request("TYPE I")

// stor file
bs := ioutil.ReadFile("./img_temp/myimage.png")

ftp.Stor("/images/myimage.png", bs)

ftp.Quit()      

}

result on command line :
<cmd>
<code> 220
<message> FTP Server ready.
<cmd> USER [myusername_secret]
<code> 331
<message> Password required for [myuser_secret]
<cmd> PASS [mypassword_secret]
<code> 230
<message> User [myuser_secret] logged in.
<cmd> PWD
<code> 257
<message> "/" is the current directory
code: 257 , message: "/" is the current directory
<cmd> TYPE I
<code> 200
<message> Type set to I
<cmd> PASV
<code> 227
<message> Entering Passive Mode (79,127,127,81,166,78).

i can't see error in this result !
all things ok !
upload success but image is bad !
image size before upload : 398724 byte And after upload : 0 byte !!!
why? how solved this problem?

crash @ wrong host address

ftp.go | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ftp.go b/ftp.go
index d15c962..d88b6d9 100644
--- a/ftp.go
+++ b/ftp.go
@@ -32,10 +32,13 @@ func (ftp *FTP) debugInfo(s string) {

func (ftp *FTP) Connect(host string, port int) {
addr := fmt.Sprintf("%s:%d", host, port)

  • ftp.conn, ftp.Error = net.Dial("tcp", addr)
  • ftp.Response()
    ftp.host = host
    ftp.port = port
  • ftp.conn, ftp.Error = net.Dial("tcp", addr)
  • if ftp.Error != nil {
  •   return
    
  • }
  • ftp.Response()
    }

func (ftp *FTP) Login(user, passwd string) {

Project should probably renamed so it doesn't end with ".go"

$ go get github.com/smallfish/ftp.go
stat github.com/smallfish/ftp.go: no such file or directory

This is explained here -- they have apparently decided to change things so that project names can't end with ".go".

So, if you could rename this project from ftp.go to something else, like ftp or ftpgo or ftp_go, that would be great.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.