Jump to content


Photo

Timezone (SITE ZONE) support


  • Please log in to reply
5 replies to this topic

#1 2BrightSparks

2BrightSparks
  • Members
  • 44 posts
  • Gender:
    Male

Posted 21 March 2006 - 04:51 PM

Hi, is it possible to add a property that returns the FTP servers timezone, i.e. what's returned from SITE ZONE less the UTC prefix. The reason I ask is that some (annoying and non-compliant) FTP servers our customers have assume the date & time passed with MDTM is a local date & time and not UTC. In this case we need to know what timezone it's in so we can adjust it accordingly. Better yet, if you could add a new SetFileTime method, e.g. SetFileTimeEx, to take this automatically into account it would be great. We could do this manually, but I'm sure others would find such a feature very useful. At the moment the user needs to state that the FTP server is non-compliant as it's not possible to know (although if they support MLST/MLSD then they always return the date & times in UTC). Thanks.

#2 mb

mb

    Developer

  • Administrators
  • 11527 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 22 March 2006 - 05:59 AM

Hello ..

What FTP server returns the the local time in the MDTM reply and supports the SIZE ZONE command? ServU? Version?

Regards,
SmartFTP

#3 2BrightSparks

2BrightSparks
  • Members
  • 44 posts
  • Gender:
    Male

Posted 22 March 2006 - 07:05 AM

Hi, one example is GlobalSCAPE Secure FTP Server. It is taking the value passed with MDTM as a local date & time (in its timezone), but it is returning it (in MLSD) as the value passed in MDTM. For example:

SYST
215 UNIX Type: L8
FEAT
211-Features supported:
COMB target;source_list
REST STREAM
SIZE
MDTM
XCRC filename;start;end
SSCN
MLST Size*;Modify*;Create;Type*;Unique;Perm*;Lang;Media-Type;CharSet;
211 END
MDTM 20060322063927 test1.txt
213 New file modification time is set: 20060322063927

The UTC date & time is passed via MDTM. But when it's read back from via MLSD it's returning the wrong value. Once converted to the local timezone it's off by 8 hours, which just happens to be the timezone the FTP server is in. So if I pass the MDTM 8 hours off in the other direction then it works (i.e. cancel out it's offset). The FTP server doesn't support SITE ZONE in this case but the user can manually say which zone the server is in in our client software (to get around problems like this).

Running exactly the same test (same files, same timezone) with Serv-U (and others, e.g. Raiden) there's no problem:

MDTM 20060322063927 test1.txt
253 Date/time changed okay.

MLSD returns the correct date & time.

#4 2BrightSparks

2BrightSparks
  • Members
  • 44 posts
  • Gender:
    Male

Posted 29 March 2006 - 08:13 AM

You may also find the following helpful:

http://www.indyproje...05_08_15.en.iwp

It explains the SITE UTIME and MFMT extensions. Not sure if you use those or not, but with Indy (as he explains) if the FTP server supports MFMT then that is used instead of MDTM.

#5 mb

mb

    Developer

  • Administrators
  • 11527 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 29 March 2006 - 12:10 PM

Thanks. Nice article. But what server actually supports the MFMT feature?
Edit: The next version of the FTP Library will prefer MFTM instead of MDTM if available.

If there is a reliable way to detect gFTP and ncftp we can implement the SITE UTIME commands.

Edit: Pure FTP Server supports SITE UTIME as well:
http://freshmeat.net...lease_id=220345

Still the question remains how to detect the commands. Are they announced in the FEAT reply?

Regards,
-Mat

#6 saku

saku
  • Members
  • 1 posts

Posted 06 April 2006 - 08:36 AM

Thanks. Nice article. But what server actually supports the MFMT feature?
Edit: The next version of the FTP Library will prefer MFTM instead of MDTM if available.

If there is a reliable way to detect gFTP and ncftp we can implement the SITE UTIME commands.

Edit: Pure FTP Server supports SITE UTIME as well:
http://freshmeat.net...lease_id=220345

Still the question remains how to detect the commands. Are they announced in the FEAT reply?

Regards,
-Mat


cool :unsure:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users