使用 REST Alfresco 进行跨域调用

编程入门 行业动态 更新时间:2024-10-26 20:22:38
本文介绍了使用 REST Alfresco 进行跨域调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用 REST API 上传文件.fiddle.jshell/876fzzd5/5/ 是粘贴箱.>

我正在使用 malsup/jquery/form/#file-upload 跨域上传表单插件.

IE 调试工具显示从服务器收到正确的响应.但是,即使文件上传失败,也会始终调用成功回调.如果我不使用跨域 Ajax 调用,则会调用正确的回调方法(成功/错误).

有人可以告诉我可能是什么问题吗?

解决方案

这是 CORS 过滤器问题吗?如果是这样,我安装的 alfresco 会将 CORS 过滤器在 web.xml 文件中注释掉.我所要做的就是取消对过滤器的注释.这里还有一篇文章,向您展示了如何将 CORS 过滤器放入(如果它还没有):www.slideshare/jottley/cors-enable-alfresco-for-cors

I am using the REST API to upload a file. fiddle.jshell/876fzzd5/5/ is the pastebin.

I am using malsup/jquery/form/#file-upload form plugin to upload cross domain.

IE debug tools shows that the correct response is received from the server. However the success callback is always called even if the file upload fails. If I don't use a cross domain Ajax call then the correct callback methods (success/error) are called.

Could some one let me know what might be the issue?

解决方案

Is this a CORS filter problem? If so, my installation of alfresco had the CORS filter commented out in the web.xml file. All I had to do was uncomment the filter. Also here is a post that shows you how to put the CORS filter in if it is not already there: www.slideshare/jottley/cors-enable-alfresco-for-cors

更多推荐

使用 REST Alfresco 进行跨域调用

本文发布于:2023-11-13 01:14:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1583002.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:REST   Alfresco

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!