Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cors 从浏览器直接将图像上载到Cloudinary时的响应302_Cors_Cloudinary_Preflight - Fatal编程技术网

Cors 从浏览器直接将图像上载到Cloudinary时的响应302

Cors 从浏览器直接将图像上载到Cloudinary时的响应302,cors,cloudinary,preflight,Cors,Cloudinary,Preflight,我按照Node.js示例项目()开发了一个简单的web应用程序,允许用户上传他们的个人资料图片。 当我尝试直接从浏览器上载图像时,我收到一条错误消息,如下所示: 无法加载XMLHttpRequest . 请求 被重定向到 “…s=%23%3CSet%3A0x0000000c75f2e0%3E&type=upload&version=1448287679&width=175”, 这是不允许的跨来源请求,需要飞行前 如上所述,问题可能是由于my node服务器上的CORS支持造成的,因此我返回到我的

我按照Node.js示例项目()开发了一个简单的web应用程序,允许用户上传他们的个人资料图片。 当我尝试直接从浏览器上载图像时,我收到一条错误消息,如下所示:

无法加载XMLHttpRequest . 请求 被重定向到 “…s=%23%3CSet%3A0x0000000c75f2e0%3E&type=upload&version=1448287679&width=175”, 这是不允许的跨来源请求,需要飞行前

如上所述,问题可能是由于my node服务器上的CORS支持造成的,因此我返回到我的服务器代码,并确保可以通过回调找到cloudinary_CORS.html。我再次运行了一个测试,但仍然得到了相同的错误。我设法找到了从控制台上传照片的选项和POST请求,POST请求返回302(请查找附加的响应消息以供参考)。但是,可以在Cloudinary仪表板上找到该图像。我怎样才能解决这个问题?任何意见都将不胜感激

远程地址:23.23.xxx.xxx:443 请求URL: 申请方式:邮寄 状态代码:302已找到 响应头 视图源 访问控制允许方法:POST、GET、OPTIONS 访问控制允许来源: 访问控制最大年龄:1728000 缓存控制:没有缓存 连接:保持活力 内容长度:840 内容类型:text/html;字符集=utf-8 日期:2015年11月23日星期一14:07:59 GMT 地点:。。。 服务器:cloudinary 状态:302找到 X-Request-Id:5dae5c1d34551a10 X-UA-兼容:IE=Edge,chrome=1 请求头 视图源 接受:/ 接受编码:gzip,deflate 接受语言:en-US,en;q=0.8,zh CN;q=0.6,zh;q=0.4 连接:保持活力 内容长度:1197 内容类型:多部分/表单数据;边界=----WebKitFormBoundaryhrzAgVFkPZMRAPo9 主持人:api.cloudinary.com 来源: 推荐人: 用户代理:Mozilla/5.0(Macintosh;英特尔Mac OS X 10_11_1)AppleWebKit/537.36(KHTML,如Gecko)Chrome/46.0.2490.86 Safari/537.36 请求有效载荷 ------WebKitFormBoundaryhrzAgVFkPZMRAPo9 内容配置:表单数据;name=“时间戳”

1448287672 
------WebKitFormBoundaryhrzAgVFkPZMRAPo9 
Content-Disposition: form-data; name="callback"

http://localhost:3000/cloudinary_cors.html 
------WebKitFormBoundaryhrzAgVFkPZMRAPo9 
Content-Disposition: form-data; name="return_delete_token"

1 
------WebKitFormBoundaryhrzAgVFkPZMRAPo9 
Content-Disposition: form-data; name="signature"

19f131b28f7da0bca1e78bf8b0820abc8653206e 
------WebKitFormBoundaryhrzAgVFkPZMRAPo9 
Content-Disposition: form-data; name="api_key"

367827361899815 
------WebKitFormBoundaryhrzAgVFkPZMRAPo9 
Content-Disposition: form-data; name="file"; filename="default_qrcode.png" 
Content-Type: image/png

------WebKitFormBoundaryhrzAgVFkPZMRAPo9--