md5_file via ftp connection
Moderator: General Moderators
-
SidewinderX
- Forum Contributor
- Posts: 407
- Joined: Fri Jul 16, 2004 9:04 pm
- Location: NY
md5_file via ftp connection
I need to download a file using the ftp functions. However, I need to verify the files integrity. Is there a way, when I connect to the remote server, I can generate an md5 hash of the file (before the transfer so I can compare it to another md5 hash after the transfer)?
Re: md5_file via ftp connection
Unless the FTP server allows this you're going to have to download it, check the md5, and then decide if you want to keep it or not.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: md5_file via ftp connection
I think normal FTP clients compare the last modified timestamp and the filesize.
Re: md5_file via ftp connection
Off topic but
John, I reckon your signature could be:
John, I reckon your signature could be:
Code: Select all
if ($toBe || !$toBe) echo 'That is the question';
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: md5_file via ftp connection
//continues offtopic

I guess it depends how you read it out in your mind. I'm on the fence with this one!John, I reckon your signature could be:
-
crazycoders
- Forum Contributor
- Posts: 260
- Joined: Tue Oct 28, 2008 7:48 am
- Location: Montreal, Qc, Canada
Re: md5_file via ftp connection
I don't know of any FTP commands from the standard FTP RFC file that talks about generating a MD5sum of a file on the fly. This is usually done by the submitter of the file, he uploads the file in the same directory of the file he submitted and then you as a user have to download both the original file and .md5 file and compare the CAT(*.md5) to md5sum() of the file you downloaded.