Giter VIP home page Giter VIP logo

Comments (21)

chamsae avatar chamsae commented on June 26, 2024

In put(),
now, I see relative path is server.js not javascript sourcefile included command code.
I changed path './routes/ftp.txt', then it uploaded successfully.
absolute path is not used '' but '/', it is my mistake!

but, In get(), not yet, I don't know why doesn't work.

from node-ftp.

mscdex avatar mscdex commented on June 26, 2024

For your get() issue, can you enable debugging by setting debug: console.log in the object passed to connect() and upload the resulting output?

from node-ftp.

mscdex avatar mscdex commented on June 26, 2024

Also, are you able to successfully transfer this same file on the same server with a different ftp client?

from node-ftp.

chamsae avatar chamsae commented on June 26, 2024

hi mscdex!, yes, in FileZilla FTP client works very well, upload and download both. same FTP server.
um.. how can I set debugging? is there an example about this?

from node-ftp.

mscdex avatar mscdex commented on June 26, 2024

@chamsae set debug: console.log in the object you are passing to connect() and post the resulting console output here.

from node-ftp.

chamsae avatar chamsae commented on June 26, 2024

I am sorry not to understand your meaning. I'm a newbie for english, nodejs.
I didn't understand what does put in "console.log( ? );"

from node-ftp.

mscdex avatar mscdex commented on June 26, 2024

Example:

ftp.connect({
  host: '127.0.0.1',
  user: 'foo',
  password: 'bar',
  debug: console.log // <-- add this line
});

from node-ftp.

chamsae avatar chamsae commented on June 26, 2024

OK! thank you for giving example!

Express server listening on port 3000
< '220 FTP Server ready .. \r\n'
Parsed response: code=220; buffer='FTP Server ready ..'
==============FTP greeting event===
> 'USER foo'
< '331 Password required for foo\r\n'
Parsed response: code=331; buffer='Password required for foo'
> 'PASS *******'
< '230-Allowed to connect server only in Korea.\r\n230 User foo logged in\r\n'
Parsed response: code=230; buffer='Allowed to connect server only in Korea.\r\nUser foo logged in'
> 'FEAT'
< '211-Features:\n MDTM\n REST STREAM\n SIZE\r\n211 End\r\n'
Parsed response: code=211; buffer='Features:\n MDTM\n REST STREAM\n SIZE\r\nEnd'
> 'TYPE I'
< '200 Type set to I\r\n'
Parsed response: code=200; buffer='Type set to I'
> 'PASV'
< '227 Entering Passive Mode (112,175,50,229,226,154).\r\n'
Parsed response: code=227; buffer='Entering Passive Mode (112,175,50,229,226,154).'
> 'SYST'
< '215 UNIX Type: L8\r\n'
Parsed response: code=215; buffer='UNIX Type: L8'
UNIX
> 'LIST'
< '150 Opening ASCII mode data connection for file list\r\n'
Parsed response: code=150; buffer='Opening ASCII mode data connection for file list'
< '226 Transfer complete\r\n'
Parsed response: code=226; buffer='Transfer complete'
=============FTP ready event===========
> 'PASV'
< '227 Entering Passive Mode (112,175,50,229,217,238).\r\n'
Parsed response: code=227; buffer='Entering Passive Mode (112,175,50,229,217,238).'
> 'RETR ./www/galleryImage/sdf222222s.txt'
< '550 ./www/galleryImage/sdf222222s.txt: No such file or directory\r\n'

C:\Users\HUMMING\Dropbox\vvvv13\NodeMail\routes\ftpWork.js:40
                throw err;
                      ^
Error: ./www/galleryImage/sdf222222s.txt: No such file or directory
    at makeError (C:\Users\HUMMING\Dropbox\vvvv13\NodeMail\node_modules\ftp\lib\ftp.js:1074:13)
    at Socket.ondata (C:\Users\HUMMING\Dropbox\vvvv13\NodeMail\node_modules\ftp\lib\ftp.js:263:27)
    at Socket.EventEmitter.emit (events.js:96:17)
    at TCP.onread (net.js:392:31)

Process finished with exit code 1

from node-ftp.

mscdex avatar mscdex commented on June 26, 2024

Ok, that's a different error. Can you provide the output that generates the 'vsf_sysutil_recv_peek: no data' error?

from node-ftp.

chamsae avatar chamsae commented on June 26, 2024

path is like below.

ftpTree

from node-ftp.

mscdex avatar mscdex commented on June 26, 2024

What if you try using '/www/galleryImage/sdf222222s.txt', without the '.' in front? Or change to the 'www' directory, then to the 'galleryImage' directory, and then try get()'ing 'sdf222222s.txt'?

from node-ftp.

chamsae avatar chamsae commented on June 26, 2024

Ok. I'll try that.

and I don't know why.. no more occur first error "[Error: OOPS: vsf_sysutil_recv_peek: no data] code: 500".
now, it just occurs "Error: ./www/galleryImage/sdf222222s.txt: No such file or directory".
it maybe just path error.

from node-ftp.

chamsae avatar chamsae commented on June 26, 2024

WOW suceess download. thank you very much, mscdex!!!
it just because '.' in front!

Express server listening on port 3000
< '220 FTP Server ready .. \r\n'
Parsed response: code=220; buffer='FTP Server ready ..'
==============FTP greeting event 서버가 뭔가 보내고 난 다음에 뜨는 거래===
> 'USER foo'
< '331 Password required for foo\r\n'
Parsed response: code=331; buffer='Password required for foo'
> 'PASS ******'
< '230-Allowed to connect server only in Korea.\r\n230 User foo logged in\r\n'
Parsed response: code=230; buffer='Allowed to connect server only in Korea.\r\nUser foo logged in'
> 'FEAT'
< '211-Features:\n MDTM\n REST STREAM\n SIZE\r\n211 End\r\n'
Parsed response: code=211; buffer='Features:\n MDTM\n REST STREAM\n SIZE\r\nEnd'
> 'TYPE I'
< '200 Type set to I\r\n'
Parsed response: code=200; buffer='Type set to I'
> 'PASV'
< '227 Entering Passive Mode (112,175,50,229,212,233).\r\n'
Parsed response: code=227; buffer='Entering Passive Mode (112,175,50,229,212,233).'
> 'SYST'
< '215 UNIX Type: L8\r\n'
Parsed response: code=215; buffer='UNIX Type: L8'
UNIX
> 'LIST'
< '150 Opening ASCII mode data connection for file list\r\n'
Parsed response: code=150; buffer='Opening ASCII mode data connection for file list'
< '226 Transfer complete\r\n'
Parsed response: code=226; buffer='Transfer complete'
=============FTP ready event===========
> 'PASV'
< '227 Entering Passive Mode (112,175,50,229,158,198).\r\n'
Parsed response: code=227; buffer='Entering Passive Mode (112,175,50,229,158,198).'
> 'RETR /www/galleryImage/bloom_two_iphone.jpg'
< '150 Opening BINARY mode data connection for /www/galleryImage/bloom_two_iphone.jpg (191812 bytes)\r\n'
Parsed response: code=150; buffer='Opening BINARY mode data connection for /www/galleryImage/bloom_two_iphone.jpg (191812 bytes)'
< '226 Transfer complete\r\n'
Parsed response: code=226; buffer='Transfer complete'
> 'MODE S'
< '200 Mode set to S\r\n'
Parsed response: code=200; buffer='Mode set to S'

from node-ftp.

chamsae avatar chamsae commented on June 26, 2024

and I have another problem just now about connection, could you answer more?

from node-ftp.

mscdex avatar mscdex commented on June 26, 2024

sure, go ahead

from node-ftp.

chamsae avatar chamsae commented on June 26, 2024

You looks very kind, thank you.
I start,

I want to keep FTP connection for forever until I shutdown Express Server though not transferring file or listing.
but default setting seems to disconnect after 900 second, and emit error.
where can I edit code?

===========FTP error event=========
{ [Error: No transfer timeout (900 seconds): closing control connection] code: 421 }
============FTP end event====
===========FTP close event====

events.js:71
throw arguments[1]; // Unhandled 'error' event
^
Error: watch ECONNRESET
at errnoException (fs.js:806:11)
at FSEvent._handle.onchange (fs.js:824:26)

from node-ftp.

chamsae avatar chamsae commented on June 26, 2024

or I think,
It would be fine, it reconnect when need to transfer.
In normal case of FTP Client Program like FileZilla, it seems do that.

anyway, I tried reconnect after disconnect(maybe.. 'close event').
is it a right way?

c.on('close', function(hadErr){
console.log("===========FTP close event====");

c.connect({
    host : localhost,
    port : 21,
    user : 'myname',
    password : 'mypass',
    debug : console.log
});

});

simply, I want to fix the error "Error: No transfer timeout (900 seconds): closing control connection] code: 421",
and automatically reconnect when need transferring file.
could you comment me how can I do?

from node-ftp.

mscdex avatar mscdex commented on June 26, 2024

Ok, the keepalive mechanism should be fixed in c7aecf3. Give it a try with npm install https://github.com/mscdex/node-ftp/tarball/master. By default it will perform a NOOP every 10 seconds.

from node-ftp.

chamsae avatar chamsae commented on June 26, 2024

it maybe works!

NOOP
< '200 NOOP command successful\r\n'
Parsed response: code=200; buffer='NOOP command successful'

then, after setting like this, never close connection?
this is what I want, but I don't know whether this is good way.
FileZilla FTP Client seems to reconnect if need transferring, after quickly closing.
how do you think about this?

c.connect({
host : localhost,
port : 21,
user : 'myname',
password : 'mypass',
debug : console.log
keepalive : 30000
});

from node-ftp.

mscdex avatar mscdex commented on June 26, 2024

You could probably do both: rely on keepalive and reconnect if disconnected. It's difficult to say if any given server will kill a connection if it sees the client is just continually sending NOOPs. I would hope most would not though and would keep the connection open.

from node-ftp.

chamsae avatar chamsae commented on June 26, 2024

Ok, thank you mscdex.
I don't know whether have bothering you today many time.
you are good programmer. see you later.

from node-ftp.

Related Issues (20)

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.