Files
ftp-server/src/commands/registration/rest.js
2025-05-29 15:56:59 +02:00

17 lines
526 B
JavaScript

import _ from 'lodash'
export default {
directive: 'REST',
handler: function ({ command } = {}) {
const arg = _.get(command, 'arg')
const byteCount = parseInt(arg, 10)
if (isNaN(byteCount) || byteCount < 0) return this.reply(501, 'Byte count must be 0 or greater')
this.restByteCount = byteCount
return this.reply(350, `Restarting next transfer at ${byteCount}`)
},
syntax: '{{cmd}} <byte-count>',
description: 'Restart transfer from the specified point. Resets after any STORE or RETRIEVE'
}