aspose file tools
The moose likes Java in General and the fly likes FTP file copy problem with timestamp? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "FTP file copy problem with timestamp?" Watch "FTP file copy problem with timestamp?" New topic
Author

FTP file copy problem with timestamp?

prem kanna
Greenhorn

Joined: Sep 10, 2008
Posts: 26
Hi,

Can any one tell me how to set file lastModifiedTime after copying files through FTP. I am using commons-net-1.4.1.jar to copy files from local system to server.
Eg: local file name “test.doc” (Today, December 29, 2009, 5:09:33 PM) when I moving this file to server, the files are moved successfully but the time is updated as server current time. But I need local file time like (Today, December 29, 2009, 5:09:33 PM). Below code I am using for uploading files to server.




Can any one please help me to overcome this issue?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

I don't think the FTP protocol supports this. Any FTP program I've used so far simply sets the last modified date as "now".


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 9950
    
    6

you might be able to tar them up, ftp the tarball, then untar them on the destination machine. I think that would preserve the timestamps.


Never ascribe to malice that which can be adequately explained by stupidity.
prem kanna
Greenhorn

Joined: Sep 10, 2008
Posts: 26
hi,

i didnt get any answer for my problem. can any one please give some Suggestion to solve my problem.

Thanks in advance.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 9950
    
    6

did you try what I suggested?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: FTP file copy problem with timestamp?
 
Similar Threads
correct file names are not showing properly while uploading through FTP?
FTP via web application
how to write ftp code in android
Problem FTP the files using java
Need Expert help with FTP