File size: 650 Bytes
66e0f27
a4be0a3
 
66e0f27
a4be0a3
 
66e0f27
dd66be3
a4be0a3
66e0f27
a4be0a3
66e0f27
 
 
 
a4be0a3
66e0f27
a4be0a3
66e0f27
a4be0a3
 
 
 
 
 
66e0f27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
console.log("ftp.....")
const ftp = require("basic-ftp");

async function testFTPConnection() {
  const client = new ftp.Client();
  client.ftp.verbose = true;
  client.ftp.timeout = 10000;

  try {
    console.log("FTP接続テストを開始...");
    await client.access({
      host: "ftpupload.net", // 必要に応じて修正
      user: process.env["FTPname"],
      password: process.env["FTPpsw"],
      secure: false
    });
    console.log("FTP接続に成功しました!");
  } catch (err) {
    console.error("FTP接続に失敗しました:");
    console.error(err);
  } finally {
    client.close();
  }
}

testFTPConnection();