How can I let visitors upload files to my website without putting the server at risk?

Ce contenu n'est disponible qu'en roumain et en anglais ; le texte anglais est affiché ci-dessous.

How can I let visitors upload files to my website without putting the server at risk?

Treat every uploaded file as potentially dangerous. Allow only the formats your application needs, and validate the file extension, type and contents on the server. Checks performed only in the browser can be bypassed.

Store uploads outside the public web directory where your application supports this, and serve downloads through a mechanism that checks access permissions. If uploads must sit in a public directory, configure it to prevent uploaded files from executing code. Generate new filenames and prevent existing files from being overwritten.

Set limits on file sizes and upload counts, add malware scanning, and test with harmless files. Do not rely on scanning alone: access restrictions and preventing code execution remain essential.

QUESTIONS SIMILAIRES

Voici quelques questions dont les réponses pourraient vous intéresser. Nous répondons aux questions importantes et pratiques de nos clients.

ABONNEZ-VOUS À LA NEWSLETTER

Abonnez-vous à notre newsletter. Nous l’utilisons uniquement pour les informations importantes.

Illustration abonnement à la newsletter