QuorumDMS/ftp-srv

ENOENT: no such file or directory on Windows

felipesmendes opened this issue · 0 comments

Hi,
I need a simple FTP server then I decided to try this package.

So I'm using Windows and created this simple configuration:

import FtpSrv from 'ftp-srv';
// Quick start, create an active ftp server.


const port = 2121;
const ftpServer = new FtpSrv({
    url: "ftp://0.0.0.0:" + port,
    anonymous: true,
    pasv_url: '201.48.168.101'
});

ftpServer.on('login', (data, resolve, reject) => {
    if (data.username === 'anonymous' && data.password === '@anonymous') {
        return resolve({ root: "/" });
    }
    return reject(new errors.GeneralError('Invalid username or password', 401));
});
ftpServer.on('RETR', (error, filePath) => {
    console.log("CHEGOU ARQUIVO", filePath);

});
ftpServer.listen().then(() => {
    console.log('Ftp server is starting...')
}).catch(e => {
    console.log(e);
});

So when I try to connect and upload a file using the simple Windows Explorer i'm receiving this error:

{"name":"ftp-srv","hostname":"DESKTOP-GFJ00I2","pid":5848,"level":30,"protocol":"ftp","ip":"0.0.0.0","port":"2121","msg":"Listening","time":"2022-06-15T12:54:29.037Z","v":0}
Ftp server is starting...
{"name":"ftp-srv","hostname":"DESKTOP-GFJ00I2","pid":5848,"id":"7a2e937e-0f21-4b48-9ecf-e54fd99e7c3f","ip":"201.48.168.101","directive":"DELE","level":50,"err":{"message":"ENOENT: no such file or directory, stat 'C:\\Erros SD 
CARD.pdf'","name":"Error","stack":"Error: ENOENT: no such file or directory, stat 'C:\\Erros SD CARD.pdf'","code":"ENOENT"},"msg":"ENOENT: no such file or directory, stat 'C:\\Erros SD CARD.pdf'","time":"2022-06-15T12:54:35.993Z","v":0}

I tried to find somebody with same error here but not successfuly