View Full Version : Fileupload File Types

11 Oct 2009, 11:08 PM
Hello experts,

In the ExtJS example in fileupload, how can I force the file upload field to choose only specific file types? e.g. .jpg or .doc only?


9 Nov 2009, 11:11 PM

Bruce wang
9 Nov 2009, 11:15 PM
i have the same problem ,maybe it can't implement .

11 Nov 2009, 6:56 AM
inside the Ext.onReady using the file example try this.

fbutton.fileInput.dom.accept = "text/html,text/plain";

Setting the accept property to the content type you need.
It is comma separated.

Let me know if this helps.

I looked in firebug while viewing the sample putting a break before the formpanel loaded from the Ext.onReady.


11 Nov 2009, 8:03 PM
Hi, thanks for the reply, Tried your solution but I got no luck. :(

12 Nov 2009, 6:56 AM
Yeah sorry should have clarified it works in Opera fine but not the other browsers. And Opera still gives All files so kinda point less.

For IE you can force the dom to use it by using the DOM.prototype.

But the other browsers just need to get this working lol.

It's been in the w3c for too long to not be supported.


25 Nov 2009, 8:15 AM
I found that using swfupload for file uploads allows you to change the file type you want to see using the file dialog by using flash to control it.


The link above is a nice file upload queue that uses swfupload in which you can tell it what file types.

File types are assigned like so:


Separated by a semicolon.

Hope this helps :)

25 Nov 2009, 7:10 PM

Thanks. Really cool.