Added integrity checks for file uploads