Question: I created a DOJO browse button to upload files to the server . The button works fine . However i would like to be able to restrict my file selection to \*.jpg files only . In DOJO dojox.form.FileUploader i could use the Filemask attribute to select / mask files to be uploaded to the server . Example :

```
var fileMask = ["Images", "*.jpg;*.jpeg;*.gif;*.png"]

var uploader = new dojox.form.FileUploader({
    button:dijit.byId("myFakeButton"),
    uploadUrl:uploadUrl,
    fileMask:fileMask
});

```

However dojox.form.FileUploader is now deprecated ( soon to be deprecated ) and replaced by dojo.form.uploader . In this i am unable to find any property that can mimic the filemast capability . I read the [official Dojo Uploader documenation](http://dojotoolkit.org/documentation/tutorials/1.9/uploader/) but it does not mention anything about filemask . 

Anyone faced this issue ?

Answer: 
dojox.form.Uploader generated a DOM Element temporarily to deal with file uploading operation. so we could track the DOM generated with dojo.aspect like this:

```
var uploader = new Uploader({...}, ...);
aspect.after(uploader._inputs, "push", function(method, args) {
    args[0].accept = "image/jpg,image/jpeg,image/gif,image/png";
});

```
Or override Uploader.\_createInput
Just add one line: 

```
accept : ".xls,.xlsx,.xlsm,.csv" // Just add the line

```

like this

```
_createInput: function(){
alert("_createInput 1");
if(this._inputs.length){
domStyle.set(this.inputNode, {
top:"500px"
});
this._disconnectButton();
this._nameIndex++;
}
alert("_createInput 2");
var name = this._getFileFieldName();
alert("_createInput 3");
// reset focusNode to the inputNode, so when the button is clicked,
// the focus is properly moved to the input element
alert("_createInput 4");
this.focusNode = this.inputNode = domConstruct.create("input", {type:"file", name:name, "aria-labelledby":this.id+"_label",
accept : ".xls,.xlsx,.xlsm,.csv" // Just add the line
}, this.domNode, "first");
alert("_createInput 5");
if(this.supports("multiple") && this.multiple){
domAttr.set(this.inputNode, "multiple", true);
}
alert("_createInput 6");
this._inputs.push(this.inputNode);

alert("_createInput 7");
domStyle.set(this.inputNode, {
position:"absolute",
fontSize:this.inputNodeFontSize+"em",
top:"-3px",
right:"-3px",
opacity:0
});
alert("_createInput 8");
this._connectButton();
alert("_createInput 9");
},

```