sergi/jsftp

Uploaded images are broken

Closed this issue · 1 comments

            fs.readFile(localFilePath, 'uft8', (_err, buffer) => {
                if (_err) {
                    reject(_err);
                } else {
                    ftp.put(buffer, remoteFilePath, (err) => {
                        if (err) {
                            reject(err);
                        } else {
                            resolve();
                        }
                    });
                }
            });

or

                    ftp.put(localFilePath, remoteFilePath, (err) => {
                        if (err) {
                            reject(err);
                        } else {
                            resolve();
                        }
                    });

These two ways reproduces the same problem on pure-ftp.
Uploaded images are not the same as local files

Actually type I is need before uploading a image.
see why-do-i-get-200-type-set-to-i-netftpreplyerror