-
29 Nov 2012 1:33 AM #1
Unanswered: Displaying only specific types of files in the filefield control
Unanswered: Displaying only specific types of files in the filefield control
Hi,
I want to show only CSV files using filefield the dialog are only CSV files. Is there some property in 'filefield ' needs to be set/overriden?
Thanks in advance.
-
29 Nov 2012 1:39 AM #2Sencha User
- Join Date
- Dec 2009
- Location
- Enschede, The Netherlands
- Posts
- 327
- Vote Rating
- 11
- Answers
- 16
There is no option to do this on form.field.File as far as I know.
One direction for a solution might be: http://stackoverflow.com/questions/8...ific-file-type, however this doesn't work in every browser. Which might be the reason ExtJS doesn't support it - nor will.
I fear this is going to be a tricky one since most browsers are focusing on the webpage not being able to interfere with the local computer.
-
29 Nov 2012 1:45 AM #3
Impossibile ^^
You can't filter displayed file types. It's restricted by browsers. What you can do is add a validator, which checks the ".csv"
Only files with .csv:
Code:regex: /^.*\.(csv|CSV)$/, regexText: 'Only CSV files allowed'
Last edited by Arg0n; 29 Nov 2012 at 1:59 AM. Reason: added code example o.O
-
3 Dec 2012 8:56 AM #4
-
3 Dec 2012 1:10 PM #5
Better way would be to build an own validator for it.
See: Form Package Guide (2. Custom Validations)
=)


Reply With Quote