167
Views
3
Comments
Need to show only PDF files in the upload Icon Explorer
Question
Application Type
Reactive

Hi team, 

Requirement is when we click the upload Icon the explorer is opened , In the explorer it self we need to show only PDF files only specific format files we need to show, 

How we can achieve this any one can support 

Current View in Upload Explorer 


Requirement 


Only specific format , Excel or PDF or Word



2022-11-15 12-05-50
Zafar Sultan

Hi Murugan,

This can be achieved by specifying "accept" property of file upload widget. 

You can specify multiple file formats in comma separated string.


But, here is a catch. It will initially filter the files based on the "accept" property but user can still select other file types.



So, you can use this property to initially filter the file types to be uploaded but for concrete solution you must check the file type on client side as well as server side.

2023-01-25 05-43-21
Murugan S S

Hi Zafer, 


I have done this but the dropdown should not show all files thats the challenge . 

Thanks

Murugan S S


2022-11-15 12-05-50
Zafar Sultan

Hi Murugan,

You can validate the file type while selecting, uploading(in client action) and in server action only. You can not control browser's behavior from your code. The above behavior is provided by browsers and is for user's convenience only.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.