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";
});

```
You can set the type by the `accept` attribute and configure it using the mime type.

```js
dojo.require("dojox.form.Uploader");

var tbl = document.getElementById('hola');
var fileInput = document.createElement('input');
fileInput.type = 'file'; //fallback

fileInput.setAttribute("data-dojo-type", "dojox.form.Uploader");
fileInput.setAttribute('accept', 'image/jpeg');
fileInput.setAttribute('data-dojo-props', 'name:"uploadedfile", label:"Select Some Files"');
tbl.appendChild(fileInput);
```

```css
div {
  border: 1px;
  border-style: dashed;
}
```

```html
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js"></script>
<script src="http://amd.egoworx.com/jsfiddle-dojo-require.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/dojo/1.8/dijit/themes/claro/claro.css" rel="stylesheet" />
<div id="hola"></div>
```