IDataServiceStreamProvider来自JQuery的Post Url [英] IDataServiceStreamProvider Post Url from JQuery

查看:91
本文介绍了IDataServiceStreamProvider来自JQuery的Post Url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我读过这篇文章 - http://social.msdn.microsoft.com/Forums/en-SG/adodotnetdataservices/thread/88f76eef-360d-42ab-b340-4e413d400073


我是否可以使用此服务实现并从html + jquery客户端使用它来发布txt文件,如


http://localhost/service.svc /uploadfile/noname.txt


我不想创建一个客户端上下文应用程序,只是从一个html页面调用它并能够发布//上传txt文件。甚至可能吗?


请告知。


谢谢

解决方案

< blockquote>


这里有一个很好的演练:
http://blogs.msdn.com/b/astoriateam/archive/2010/08/ 04 / data-services-streaming-provider-series-implementation-a-streaming-provider-part-1.aspx


如果你在服务中这样做,那么上传一个二进制blob(无论是否是文本文件)只是POST到service / MyEntitySet。此处描述了协议交互:
http://www.odata.org/developers/protocols/operations (参见2.5创建媒体链接条目),它基本上只是对ATOM PUB的引用( http://tools.ietf。 org / html / rfc5023


您不必使用客户端上下文,就像OData的其余部分一样,它只是普通的HTTP / REST。


谢谢,


Hi,

I read this post -http://social.msdn.microsoft.com/Forums/en-SG/adodotnetdataservices/thread/88f76eef-360d-42ab-b340-4e413d400073

Can I use this service implementation and use it from a html +jquery client to post txt files to it like

http://localhost/service.svc/uploadfile/noname.txt

I do not wish to create a client context application and just call it from a html page and be able post//upload txt files. Is it even possible?

Please advise.

thanks

解决方案

Hi,

A nice walkthrough is here: http://blogs.msdn.com/b/astoriateam/archive/2010/08/04/data-services-streaming-provider-series-implementing-a-streaming-provider-part-1.aspx

If you do that in your service then uploading a binary blob (be it text file or not) is just POST to service/MyEntitySet. The protocol interaction is described here: http://www.odata.org/developers/protocols/operations (see 2.5 Creating Media Link Entries), it's basically just a reference to ATOM PUB (http://tools.ietf.org/html/rfc5023)

You don't have to use client context, as with the rest of OData it's just plain HTTP/REST.

Thanks,


这篇关于IDataServiceStreamProvider来自JQuery的Post Url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆