You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-users@mina.apache.org by "Yajun.Dong" <do...@gmail.com> on 2009/04/24 09:40:19 UTC

How to get the file-length from the ftp server?

Hi:
Excuse me, How can i get the file-length of uploading file from client in
ftp server? i check it whether the file is intergrated, so that i will
translate it to my system.

from China.

Re: How to get the file-length from the ftp server?

Posted by Ulysess Lee 李宇光 <uk...@gmail.com>.
Hard to get the meaning, I guess what you want is :
onUploadEnd(FtpSession session, FtpRequest request) in Ftplet 

and you could get file like :FtpFile f = session.getFileSystemView().getFile(arg0)
f.getSize()


----- Original Message -----  
From: Yajun.Dong  
To: ftpserver-users  
Sent: 2009-04-24, 15:40:19 
Subject: How to get the file-length from the ftp server? 


Hi: 
Excuse me, How can i get the file-length of uploading file from client in 
ftp server? i check it whether the file is intergrated, so that i will 
translate it to my system. 

from China.

Re: How to get the file-length from the ftp server?

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Fri, Apr 24, 2009 at 9:40 AM, Yajun.Dong <do...@gmail.com> wrote:
> Excuse me, How can i get the file-length of uploading file from client in
> ftp server? i check it whether the file is intergrated, so that i will
> translate it to my system.

Do you want to check the length of the file before the client uploads?
If so, that is not possible within the  FTP protocol. if you want to
check the length after the file has been uploaded (for example from an
Ftplet), you can use the org.apache.ftpserver.ftplet.FtpFile.getSize()
method.

/niklas