File upload security involves several checks to keep servers safe. First, when a user uploads a file, the server checks the file extension to allow only certain types like images. If the extension is not allowed, the file is rejected immediately. Next, the server checks the file size to ensure it is below a set limit, rejecting files that are too large. Then, the server scans the file for malware to detect harmful content. Only if the file passes all these checks is it saved on the server and made accessible to the user. This process prevents harmful files from being stored and protects the system from attacks.