29 Nov 2012 1:33 AM #1
Unanswered: Displaying only specific types of files in the filefield control
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 #2
- Join Date
- Dec 2009
- Enschede, The Netherlands
- Vote Rating
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
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:
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