The logic you present is correct. In general SHA1 would be used when security is a concern. You could use a simpler method to check that the data is valid. Size of the file actually downloaded, etc. However, the logic you present is a more thorough check on the validity of the data received from the server, and if the SHA1 sums check out, you have accurately guaranteed that the user has received the data that you sent.
I believe HTTP and FTP transfer protocols both guarantee this for you though. By guarantee, meaning that you will be notified in the event that a partial file has been downloaded, or returned success in the event the file was completely and accurately received. So unless security is an issue, the SHA1 check is overkill. If it is necessary, you would also need to encrypt this hash in a public/private key type of scheme.