Closed justmatt25 closed 7 years ago
Check out the following
In 'image-validation', the array type passed enabled the files the drop zone accepts (you just need to identify what the file type is for pdf, xlsx etc.).
In 'size-validation' the type array is omitted showing how you can accept any file type.
For Excel Files 97-2003 (.xls), use: application/vnd.ms-excel For Excel Files 2007+ (.xlsx), use: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet For CSV files (.csv), use: .csv
In my application I am supporting above 3, so supported file array looks like
supportedFileTypes: string[] = ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', '.csv'];
For more details refer to this link https://stackoverflow.com/questions/11832930/html-input-file-accept-attribute-file-type-csv
Basically I need to be able to accept .pdf, .xlsx, etc but I can't seem to figure out how to do it. I tried editing this line of code:
private supportedFileTypes: string[] = ['image/png', 'image/jpeg', 'image/gif', ];
but it didn't seem to take. How would I go about doing this?