0
JSFTPを使用してファイルを送信します。 まず、ファイルを置くフォルダを作成する必要があります。 これは問題なく動作しているため、接続は正常です。 しかし、私はこの得たファイルをアップロードしたい:私が得た理由を私は理解できないJSFtpとJavascriptを使用してファイルを送信する
DEBUG: user_command
"stor fo994201-836f-48d0-925b-52068b8a49be/20160511/undefined"
DEBUG: response
{
"code": 550,
"text": "550 '' was not found.",
"isMark": false,
"isError": true
}
{ [Error: 550 '' was not found.] code: 550 }
を:STORコマンドで未定義の... これはフォルダおよび送信をレコード生成コードの一部でありますファイル:
//Create the new folder
Ftp.raw.mkd("fo994201-836f-48d0-925b-52068b8a49be/"+date, function(err, data) {
if (err) return console.error(err);
console.log(data);
console.log("Trying to Upload file.");
for (var i=1; i<filenames.length; i++){
console.log (" Sending : " + filenames[i]);
fs.readFile(path+date+'/'+filenames[i], "binary", function(err, data) {
var buffer = new Buffer(data, "binary");
Ftp.put(buffer, 'fo994201-836f-48d0-925b-52068b8a49be/'+date+'/'+filenames[i], function(err) {
if (err){
console.log(err);
} else {
console.log("File uploaded successfully");
}
setTimeout(function(){}, 20000);
});
});
}
});
デバッグ出力:
Trying to Upload file.
Sending : test.txt
DEBUG: user_command
"pasv"
DEBUG: response
{
"code": 227,
"text": "227 Entering Passive Mode (54,194,108,219,214,8)",
"isMark": false,
"isError": false
}
DEBUG: user_command
"stor fo994201-836f-48d0-925b-52068b8a49be/20160511/undefined"
DEBUG: response
{
"code": 550,
"text": "550 '' was not found.",
"isMark": false,
"isError": true
}
{ [Error: 550 '' was not found.] code: 550 }