angularjs - Internet Explorer 9 and angular-file-upload not working properly -


i'm trying use upload file using angular , works except on ie9.

i tried https://github.com/danialfarid/ng-file-upload requires flash when working non-html5 browsers, not work me.

after tried https://github.com/nervgh/angular-file-upload , works! except after uploading file processing , maybe return error bad request. , not work in ie9. if upload successful code not see bad request.

well, don't think problem code, wont post here. want had same problems shed me light in do.

edit: in other words. in chrome, status 400 , in ie9 200.

uploader.oncompleteitem = function (fileitem, response, status, headers) 

edit2: think found source of error. angular-file-upload function

iframe.bind('load', function() {    try {    // fix legacy ie browsers loads internal error page    // when failed ws response received. in consequence iframe    // content access denied error thrown becouse trying    // access cross domain page. when such thing occurs notifying    // empty response object. see more info at:    // http://stackoverflow.com/questions/151362/access-is-denied-error-on-accessing-iframe-document-object    // note if non standard 4xx or 5xx error code returned    // ws response content can accessed without error    // 'xhr' status becomes 200. in order avoid confusion    // returning response via same 'success' event handler.     // fixed angular.contents() iframes         var html = iframe[0].contentdocument.body.innerhtml;      } catch (e) {}           var xhr = {response: html, status: 200, dummy: true};          var headers = {};          var response = that._transformresponse(xhr.response, headers);           that._onsuccessitem(item, response, xhr.status, headers);          that._oncompleteitem(item, response, xhr.status, headers); 

but response undefined

i figure out fix. in project enters catch statement if server returned error. there fire event onerror.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -