Using ng-file-upload for file uploading in my home has been successful, as I am able to upload files without any issues.
However, I encountered a problem where the progress bar only appears when offlinejs is disabled in the index.html file. It seems that offlineJS is interfering with the progress callback during the post call.
Below is the error message that I received:
Error: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': 'function (xhr) {
if (!xhr || !(xhr instanceof XMLHttpRequest)) return;
config.__XHR = xhr;
if (config.xhrFn) config.xhrFn(xhr);
xhr.upload.addEventListener('progress', function (e) {
e.config = config;
notifyProgress(getNotifyEvent(e));
}, false);
//fix for firefox not firing upload progress end, also IE8-9
xhr.upload.addEventListener('load', function (e) {
if (e.lengthComputable) {
e.config = config;
notifyProgress(getNotifyEvent(e));
}
}, false);
}' is not a valid HTTP header field value.
at Error (native)
at XMLHttpRequest.f.setRequestHeader (http://localhost:3000/lib/js/offline/offline.min.js:2:3272)