nervgh / angular-file-upload

[ALMOST NOT MAINTAINED] Angular File Upload is a module for the AngularJS framework
MIT License
3.44k stars 1.13k forks source link

internet explorer POST error InvalidStateError:InvalidStateError #814

Closed DanRamGim closed 6 years ago

DanRamGim commented 6 years ago

I have been using this tool for a while and i never tried it on internet explorer, on all the other browsers it works well but in IE it sends a state 11 with the error InvalidStateError:InvalidStateError.

I send my headers add the url and attach my file accordingly and it works on chrome and edge.

Do any of you know how to fix this issue?

Here is an example of my code, it works perfectly on other browsers:

var uploader = $scope.uploader = new FileUploader({
    url: $localStorage.urlupload ,
    queueLimit: 1
});

uploader.onBeforeUploadItem = function (item) { item.headers["ID"] = $localStorage.ID }

uploader.onErrorItem = function (item, response, status, headers) {
    console.info(item)
    console.info(response)
    console.info(status)
    console.info(headers)

}

The response is: item = the item i send response = InvalidStateError:InvalidStateError status = 11 headers = []

chakflying commented 3 years ago

Don't know why this was closed, on the off chance that someone in the future is working on old codebases, seems like version 2.6.0 does not work with IE11. Downgraded to 2.5.0 and solved my issue.

luumik commented 3 years ago

Don't know why this was closed, on the off chance that someone in the future is working on old codebases, seems like version 2.6.0 does not work with IE11. Downgraded to 2.5.0 and solved my issue.

Old codebase, but in my case IE11 stopped co-operation with the version 2.5.0 with the same error response. And with the very latest 2.6.0 version (not currently available via npmjs) from github fixed this for me. It seems that the latest github version is not uploaded to npmjs site. It's this bug that caused the problem with IE11 in my case: https://github.com/nervgh/angular-file-upload/issues/874