Open bansaltushar opened 8 years ago
To add a defferred.reject function in the iframe off load function catch will solve the problem.
try {
var doc = this.contentWindow ? this.contentWindow.document : this.contentDocument;
response = angular.element(doc.body).text();
// Google Chrome and Firefox do not throw an
// exception when calling iframe.contents() on
// cross-domain requests, so we unify the response:
if (!response.length) {
throw new Error();
}
} catch (e) {
deferred.reject({
data: {
message: '文件上传失败!'
}
});
return;
}
Will you be submitting this code in the library code?
I have pull request
It still doesn't work for me in IE9. Once I select a file to upload IE prompts me the save the file..
Anyone noticed this kind of behaviour before?
For IE8 or IE9, the Content-Type in Response Header should be 'text/html'.
When we try to submit a form with an angular-upload element, then in case there is an exception generated by the server which returns an http status 500, but since in IE the upload is taking place through the iframe, the angular-upload directive is always returning the http status to 200 due to which the responseError interceptor is not getting invoked. Kindly check and fix this issue. Thanks.