Unfortunately, there is no way to do that in FTP protocol. The way FTP
protocol works is -

client says that it wants to send some data to be stored in a file on the
server's file system at a specific location (e.g. /mydir/myfile.txt). Server
checks some basic things (e.g. is the directory exists, does the user have
permission to upload etc.). Then the server says to send data. Client sends
data over a new connection, called data connection, and closes the data
connection to indicate that there is no mode data. This has its
disadvantages as well as advantages. Without going into disadvantages, the
advantage is that neither the client nor the server need to know the size of
the data before it can be transmitted. For example, the client can send a
huge file while encrypting it on the fly (chunk after chunk). The encrypted
data size may or may not be same as the plain file size.

In summary, you cannot know the size of the file that is residing on the
client. As far as the file modified time, as a server, you cannot get it,
but the client can ask the server to set the file timestamp to a specific
time, by sending an MDTM command. Not sure if that would help in your
particular use case.

Hope this helps.

Sai Pullabhotla


On Fri, Sep 30, 2011 at 11:08 AM, Deepak Mehta <[email protected]>wrote:

> Hi,
>
>
>
> In apache ftp server, I want to get source file modified time and size when
> I upload file to ftp server.
>
> How can I get that?
>
>
>
> Thanks,
>
> Deepak Mehta
>
>
>
>
>

Reply via email to