PDA

View Full Version : Ext.FormPanel ! File upload form question !



altamirador
8 May 2009, 4:22 PM
Hello to all of you that will read this post !

I just build a simple file upload form. Plain and simple. Works fine !

I'd like to limit the ability of the user to choose only certain type of files based on their extensions (e.g. *.pdf or *.jpg).

I know I could do this from the backend but I'd rather do it from the frontend if possible ?

Any clues ?

Help and comments are welcomed !

Altamirador !

8 May 2009, 7:50 PM
not with generic javascript - no

Condor
9 May 2009, 12:09 AM
You can't do anything about the file browser, but you could mark the field invalid if the selected filename doesn't end with any of the allowed extensions.

lorezyra
19 May 2009, 6:31 PM
Hello to all of you that will read this post !

I just build a simple file upload form. Plain and simple. Works fine !

I'd like to limit the ability of the user to choose only certain type of files based on their extensions (e.g. *.pdf or *.jpg).

I know I could do this from the backend but I'd rather do it from the frontend if possible ?

Any clues ?

Help and comments are welcomed !

Altamirador !

If you want the file browser to limit the file types, you would have to use a combo of Javascript (to parse the filename in the textfield element) and either an applet or perhaps vbScript... (either of which requires user approval from the info bar)


The less complicated way is simply parse the text field...