My framework is Spring-MVC with AngularJS. For File Upload i am using Multipart File Upload. I created a hidden iFrame to submit file to backend. The code looks like this.
function fnUploadFile(formData){
var iframe = $('<iframe name="postiframe" id="postiframe" style="display: none"></iframe>');
$("body").append(iframe);
var form = $('#uploadform');
form.attr("action", CONTEXT_PATH+"admin/uploadPDF");
form.attr("method", "post");
form.attr("encoding", "multipart/form-data");
form.attr("enctype", "multipart/form-data");
form.attr("target", "postiframe");
form.attr("uploadfile", $('#uploadfile').val());
var input = $('<input type="hidden" name="filename"/>').val(formData);
input.appendTo(form);
form.submit();
}
After that I save the file in server location.I am having problem while uploading file from FireFox browser. Its opening a new pop-up right after we click upload button.
Can someone help resolving this issue?
Found the solution for it by myself. Just added text/plain as header in HttpServletResponse. It resolves my problem.