我已经使用这个库angular2文件上传https://github.com/valor-software/ng2-file-uploadNG2文件上传访问控制起源问题
现在我得到这个错误,当我上传文件
XMLHttpRequest cannot load http://localhost:8080/files. Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:3000' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
这解决了我的同样问题https://stackoverflow.com/a/47334113/5236174,请检查它是否是您的案例中的可接受答案。 –