【发布时间】:2017-07-06 21:16:28
【问题描述】:
我已经使用这个库来上传 angular2 文件 https://github.com/valor-software/ng2-file-upload
现在我在上传文件时收到此错误
XMLHttpRequest 无法加载 http://localhost:8080/files。对预检请求的响应未通过访问控制检查:当请求的凭据模式为“包含”时,响应中的“Access-Control-Allow-Origin”标头的值不得为通配符“*”。因此,不允许访问 Origin 'http://localhost:3000'。 XMLHttpRequest 发起的请求的凭证模式由 withCredentials 属性控制。
【问题讨论】:
-
这解决了我的stackoverflow.com/a/47334113/5236174 的相同问题,请检查您的情况是否可以接受。
标签: angular file-upload