If you want to ensure the integrity of a file before deleting it, you can store a hash of the file and compare it with the previous hash when uploading. The System.Cryptography namespace provides HashAlgorithm classes like SHA1 that can help you achieve this.
"A cryptographic hash function is a deterministic procedure that takes an arbitrary block of data and returns a fixed-size bit string, the (cryptographic) hash value, such that an accidental or intentional change to the data will change the hash value"
Here's some sample code to get you going. Assuming you have a stream variable named stream
containing your file data (you could use FileStream to open it):
var sha = new System.Security.Cryptography.SHA1Managed();
byte [] hash = sha.ComputeHash(stream);
Now, the variable hash
will contain the fingerprint of the file contents. Even a slight alteration in the file will result in a different hash value, but hashing the same file will always yield the same hash.