Python·100 questions

How to handle file uploads in web (general approach)?

Answer
Limit upload size.
Check MIME/type and extension (don't trust only extension).
Generate a new filename.
Save outside the public directory if needed.
Log events and errors.
Was this answer helpful?

More questions in this topic

Related questions from other topics