how to Filter File Browser to specific extensions on IE?

janNowak

New Member
I want to create upload file operation so I but the following code:\[code\]<img src="http://stackoverflow.com/questions/15687344/[@spring.url'/images/buttons/upload.jpg'/]" onclick="uploadFile()" title="Upload File" />//I want to do this without showing the input file<div style="display: none;"> <input id="inputFile" type="file" name="upload" accept=".txt,.csv,.zip" onchange="uploadListener();"></div>\[/code\]the image tag has nothig to do with the files just I don't want to show the input file so I use image instead to invoke it.and js like this:\[code\]function uploadFile(){ document.getElementById('inputFile').click(); } function uploadListener(){ alert($('#inputFile').val()); $.ajax({ type: "POST", url: "/panda/assay/designability/uploadFile.htm", data: {file: $('#inputFile').val()} , success: function(response){ } }); }\[/code\]this never worked to create custom filter, I found out that the "accept" attribute is not supported by IE unfortunatley I have to work with it. any suggestions??
 
Back
Top