is it possible to upload only files of an extension i.e pdf or doc and if size os single or group of files is less than x Mb #459

Open
opened 2016-10-21 13:09:23 +00:00 by ovione · 8 comments
ovione commented 2016-10-21 13:09:23 +00:00 (Migrated from github.com)
No description provided.
ovione commented 2016-10-22 17:22:49 +00:00 (Migrated from github.com)

is it possible to put somewhere a filter to allow only the upload of files with a certain extention.
i.e: only files with extentions .pdf or .doc but not .exe to be added to the list of files.

Another thing is to restrict files that are too large i.e: only allow files under 1 MB to be added to the list of files.

Another could be if the total list of files surpasses a certain size don't allow more to be added.
i.e: don't allow if the total size of the list is already 5 MB.

let me know if those 3 possibilities are possible and if not if those will be added in the future or how could we do it ourselves maybe it is possible to build a custom solution aroud this component.

thanks
O

is it possible to put somewhere a filter to allow only the upload of files with a certain extention. i.e: only files with extentions .pdf or .doc but not .exe to be added to the list of files. Another thing is to restrict files that are too large i.e: only allow files under 1 MB to be added to the list of files. Another could be if the total list of files surpasses a certain size don't allow more to be added. i.e: don't allow if the total size of the list is already 5 MB. let me know if those 3 possibilities are possible and if not if those will be added in the future or how could we do it ourselves maybe it is possible to build a custom solution aroud this component. thanks O
colmer commented 2016-10-27 08:45:29 +00:00 (Migrated from github.com)

@ovione you can use allowedMimeType to prevent upload not supported formats, maxFileSize to set maximum filesize to load:

Example:

uploader: FileUploader = new FileUploader({
    allowedMimeType: ['image/png'], //will be loaded only PNG files
    maxFileSize: 5*1024*1024 // 5 MB
});
@ovione you can use `allowedMimeType` to prevent upload not supported formats, `maxFileSize` to set maximum filesize to load: Example: ``` uploader: FileUploader = new FileUploader({ allowedMimeType: ['image/png'], //will be loaded only PNG files maxFileSize: 5*1024*1024 // 5 MB }); ```
selirah commented 2017-03-17 13:24:44 +00:00 (Migrated from github.com)

What about other file types like xls and xlsx because it only works for image/*

What about other file types like xls and xlsx because it only works for image/*
ghost commented 2017-07-05 13:31:24 +00:00 (Migrated from github.com)
public uploader = new FileUploader({
        allowedFileType: ["pdf", "xls"]
    });
``` public uploader = new FileUploader({ allowedFileType: ["pdf", "xls"] }); ```
selirah commented 2017-09-06 10:47:42 +00:00 (Migrated from github.com)

thanks @ghost

thanks @ghost
PrzemekDebowskiLasoft commented 2017-12-27 14:45:33 +00:00 (Migrated from github.com)

Hello,
it is possible to change ngClass border to red when wrong (other than "pdf") file is over dropdown area?

Hello, it is possible to change ngClass border to red when wrong (other than "pdf") file is over dropdown area?
Sritharan-racap commented 2018-04-25 20:24:43 +00:00 (Migrated from github.com)

is it possible to upload file of cutom file extension type of mimetype 'application/x-gzip'. this will be very helpful ?

is it possible to upload file of cutom file extension type of mimetype 'application/x-gzip'. this will be very helpful ?
SrideviYerneni commented 2018-07-20 15:34:35 +00:00 (Migrated from github.com)

@ghost this seems to be not working with xls and xlsx files. Could you give example of the usage please

@ghost this seems to be not working with xls and xlsx files. Could you give example of the usage please
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#459