On 31.07.25 11:25, Nowacki, Mateusz wrote:
Hello,
II work in a project where we use sftp apache mina. One of the
requirements is to add a limitation on the size of files transferred.
This parameter is not always available and depends on the client and
version used (for example winscp in older versions does not provide this
parameter).
Is there any way to read the file size before it is fully uploaded to
the server?
I don't think there is. The best you can do is keep track of block
offsets and sizes, and return a failure reply if offset + size > limit.
Maybe also keep a running sum of the sizes of data blocks received,
and return a failure reply when that sum > limit.
Cheers,
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org