Run Virus Scan on all uploaded files

Is there a way to force all uploaded files (*.py, notebooks, datafiles, etc.) to go through a security/virus scan before allowing the upload?

You can use a pre_save_hook to run arbitrary transforms on uploaded / saved files before they are stored. This can include scanning and rejecting them by raising e.g. tornado.web.HTTPError(400, "message").

1 Like