1 |
|
2 | import { MultipartFileContract } from '@ioc:Adonis/Core/BodyParser';
|
3 |
|
4 |
|
5 |
|
6 | export declare class ExtensionValidator {
|
7 | private file;
|
8 | private allowedExtensions?;
|
9 | validated: boolean;
|
10 | |
11 |
|
12 |
|
13 | get extensions(): string[] | undefined;
|
14 | set extensions(extnames: string[] | undefined);
|
15 | constructor(file: MultipartFileContract);
|
16 | /**
|
17 | * Report error to the file
|
18 | */
|
19 | private reportError;
|
20 | /**
|
21 | * Validating the file in the streaming mode. During this mode
|
22 | * we defer the validation, until we get the file extname.
|
23 | */
|
24 | private validateWhenGettingStreamed;
|
25 | /**
|
26 | * Validate the file extension after it has been streamed
|
27 | */
|
28 | private validateAfterConsumed;
|
29 | /**
|
30 | * Validate the file
|
31 | */
|
32 | validate(): void;
|
33 | }
|