I use jQuery-File-Upload and Spring MVC like server part. I try the example and it doesn't work in the IE 9 browser. It says to me: "would you like to save or open the object"
Client is like in the example:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>jQuery File Upload Example</title>
</head>
<body>
<input id="fileupload" type="file" name="files[]" data-url="/fileUpload/1" multiple>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="js/vendor/jquery.ui.widget.js"></script>
<script src="js/jquery.iframe-transport.js"></script>
<script src="js/jquery.fileupload.js"></script>
<script>
$(function () {
$('#fileupload').fileupload({
dataType: 'json',
done: function (e, data) {
$.each(data.result.files, function (index, file) {
$('<p/>').text(file.name).appendTo(document.body);
});
}
});
});
</script>
</body>
</html>
And server is:
@RequestMapping(value = "fileUpload/{id}", method = RequestMethod.POST)
@ResponseBody
public FileUploadResultDTO upload(MultipartFile file,
@PathVariable Long id,
Locale locale,
HttpServletRequest request) {
FileUploadResultDTO resultDTO = new FileUploadResultDTO();
// Logic saving file and return back response like object
return resultDTO;
}
public class FileUploadResultDTO {
private Long photoId;
private String pathToPhoto;
private String pathToSmallPhoto;
// getters/setters
}
It works in all browsers except IE