angel_file_security 1.0.0 angel_file_security: ^1.0.0 copied to clipboard
Middleware for securing file uploads.
file_security #
Middleware for securing file uploads.
Supports:
- Max file sizes
- Max # of uploaded files
- Restrict to certain extensions
- Restrict to certain content types
- Virus scan uploaded files via VirusTotal*
Your file upload API's can also be protected with throttleRequests
from angel_security
.
*Note: See VirusTotal's TOS. They do not allow use of their public API in commercial products. However, you can pay to use their private API.
Usage #
import 'package:angel_common/angel_common.dart';
import 'package:angel_file_security/angel_file_security.dart';
configureServer(app) async {
app
.chain(restrictFileUploads(
maxFiles: 3,
maxFileSize: 2000,
allowedExtensions: ['.jpg', '.png', '.gif']))
.chain(virusScanUploads('<your-api-key-here>'))
.get(...);
}