You are here: DEVPPL Forum Programming Java Forum
NOTIFICATIONS
54.070
MEMBERS
15.678
TOPICS
62.243
POSTS
  562
FLASH GAMES
7.740
TUTORIALS
 

Login

E-mail:
Password:

FTP file copy problem with timestamp?

0

Loading

FTP file copy problem with timestamp?

Postby Randy_ortan » Tue Jan 05, 2010 6:59 pm

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.
Code: Select all

File f = new File(localfilePath);
System.out.println("Storing file as remote filename: " + f.getName());
boolean retValue = ftp.storeFile(f.getName(), new FileInputStream(f));
if (!retValue) {
throw new Exception ("Storing of remote file failed. ftp.storeFile()" +
                                   " returned false.");
}




Can any one please help me to overcome this issue?
Randy_ortan
 
Reputation: 0
Posts: 12
Joined: Thu Sep 11, 2008 7:34 am
Highscores: 0
Arcade winning challenges: 0

FTP file copy problem with timestamp? - Sponsored results

Sponsored results

Login to get rid of ads

 

0

Loading

Re: FTP file copy problem with timestamp?

Postby Randy_ortan » Wed Jan 06, 2010 2:29 pm

hi,

can any one please reply me.
Randy_ortan
 
Reputation: 0
Posts: 12
Joined: Thu Sep 11, 2008 7:34 am
Highscores: 0
Arcade winning challenges: 0
^ Back to Top