mscdex / node-ftp

An FTP client module for node.js
MIT License
1.13k stars 246 forks source link

i'am use put encounter 'Could not create file'; #199

Open sowdf opened 6 years ago

sowdf commented 6 years ago

[connection] < '220 (vsFTPd 2.0.5)\r\n' [parser] < '220 (vsFTPd 2.0.5)\r\n' [parser] Response: code=220, buffer='(vsFTPd 2.0.5)' [connection] > 'USER zgb' [connection] < '331 Please specify the password.\r\n' [parser] < '331 Please specify the password.\r\n' [parser] Response: code=331, buffer='Please specify the password.' [connection] > 'PASS Zgb4399' [connection] < '230 Login successful.\r\n' [parser] < '230 Login successful.\r\n' [parser] Response: code=230, buffer='Login successful.' [connection] > 'FEAT' [connection] < '211-Features:\r\n EPRT\r\n EPSV\r\n' [connection] < ' MDTM\r\n PASV\r\n REST STREAM\r\n SIZE\r\n TVFS\r\n UTF8\r\n211 End\r\n' [parser] < '211-Features:\r\n EPRT\r\n EPSV\r\n MDTM\r\n PASV\r\n REST STREAM\r\n SIZE\r\n TVFS\r\n UTF8\r\n211 End\r\n' [parser] Response: code=211, buffer='Features:\r\n EPRT\r\n EPSV\r\n MDTM\r\n PASV\r\n REST STREAM\r\n SIZE\r\n TVFS\r\n UTF8\r\nEnd' [connection] > 'TYPE I' [connection] < '200 Switching to Binary mode.\r\n' [parser] < '200 Switching to Binary mode.\r\n' [parser] Response: code=200, buffer='Switching to Binary mode.' /Users/caozhihui/Desktop/code/web/module/androidMobile/resource/release/index.css [connection] > 'PASV' [connection] < '227 Entering Passive Mode (192,168,51,203,213,48)\r\n' [parser] < '227 Entering Passive Mode (192,168,51,203,213,48)\r\n' [parser] Response: code=227, buffer='Entering Passive Mode (192,168,51,203,213,48)' [connection] PASV socket connected [connection] > 'LIST' [connection] < '150 Here comes the directory listing.\r\n' [parser] < '150 Here comes the directory listing.\r\n' [parser] Response: code=150, buffer='Here comes the directory listing.' [connection] < '226 Directory send OK.\r\n' [parser] < '226 Directory send OK.\r\n' [parser] Response: code=226, buffer='Directory send OK.' { type: 'd', name: 'www.4399.cn', target: undefined, sticky: false, rights: { user: 'rwx', group: 'rwx', other: 'rwx' }, acl: false, owner: '0', group: '0', size: 4096, date: 2014-06-27T00:00:00.000Z } [connection] > 'PASV' [connection] < '227 Entering Passive Mode (192,168,51,203,157,117)\r\n' [parser] < '227 Entering Passive Mode (192,168,51,203,157,117)\r\n' [parser] Response: code=227, buffer='Entering Passive Mode (192,168,51,203,157,117)' [connection] PASV socket connected [connection] > 'STOR ./foo.remote-copy.txt' [connection] < '553 Could not create file.\r\n' [parser] < '553 Could not create file.\r\n'

rainer800hao commented 6 years ago

I have a same problem, but my webstorm can upload files to same remote dir.

qiuzx20 commented 6 years ago

I have a same problem,but it is successful with FLASHFXP

icetee commented 6 years ago

I think you simply have no right to upload to the root folder. Use cwd function:

c.on('ready', function() {
  c.cwd('www.4399.cn', function() {
    c.put('foo.txt', 'foo.remote-copy.txt', function(err) {
        if (err) throw err;
        c.end();
      });
  });
});
hjaiim commented 6 years ago

我也遇到了同样的问题,无法新建文件夹,你们解决了吗,求告知 I have the same problem. I cannot create a new folder. Have you solved it? Please let me know

weislywang commented 5 years ago

I have the same problem

OmegaZhou commented 4 years ago

I have the same problem and I find that I think the file in FTP server is the remote file but it's the local file in the method, so maybe you can try to exchange the location of the parameters.