Comments (21)
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.
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.
Also, are you able to successfully transfer this same file on the same server with a different ftp client?
from node-ftp.
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.
@chamsae set debug: console.log
in the object you are passing to connect() and post the resulting console output here.
from node-ftp.
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.
Example:
ftp.connect({
host: '127.0.0.1',
user: 'foo',
password: 'bar',
debug: console.log // <-- add this line
});
from node-ftp.
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.
Ok, that's a different error. Can you provide the output that generates the 'vsf_sysutil_recv_peek: no data' error?
from node-ftp.
path is like below.
from node-ftp.
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.
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.
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.
and I have another problem just now about connection, could you answer more?
from node-ftp.
sure, go ahead
from node-ftp.
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.
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.
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.
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.
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.
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)
- File not fully uploaded HOT 2
- routines:ssl_choose_client_version:unsupported
- Could not get "pipe" of undefined.
- Ready And Greeting Event not triggered while connecting
- Error: You aren't logged in HOT 3
- is there a way to get an index.html? HOT 1
- encode strings to latin-1
- Error: connect ECONNREFUSED 127.0.0.1:21 HOT 2
- connect with different interface (like eth2)
- rmdir (recursive) fails with unicode chacaters HOT 1
- New maintainers needed for ftp in node
- transfer get stuck
- Catch connection error is not possible HOT 1
- ECONNRESET Error using ftp after few mintues HOT 1
- [Doubt] list of files/folders of FTP SERVER
- Corrupted zip when I download them with the package
- Connect directly into specified remote directory
- Error occurred when running in Electron.
- Add Promise versions of methods
- Issue with Vercel, works perfectly on local
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-ftp.