Now there is a requirement: when uploading files, all uploaded files, as long as the content is the same, only in the server to save a copy.
How do I compare file contents? If the mind was constrained at the time, it was hard to think of a way to compare file contents.
Workaround:
File upload, it must be used to read the file stream, the same source of file content is: Stream read out the same byte code. This thought of the solution, but the problem came again. How do I compare byte codes? It is not a good solution to think of such a long bytecode, if compared with the Equals method of the string. After some thinking, I decided to stream read out the bytecode for MD5 encryption, with the encrypted string as the file name , and then in the file upload (the same file content, the natural file name is the same, and then automatically covered), so that the need to solve.
How to fix the same file content when uploading files