file_security

version 1.0.1 build status

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(...);
}

Libraries

angel_file_security