开发者

Restful WCF Data Service to up- and download large files?

I'm thinking about to write a restful service which is able to upload and stream large video files (GB) (in future it might not only be videos and could also be large documents.

I researched so far and what really makes sense to me could be to use off:

WCF Data Services an开发者_运维问答d Implement IDataServiceStreamProvider and on the back-end I want to Strore the large files into SQL SERVER 2008 using the new SQL Type FILESTREAM.Looks also like I had to use some Win 32 API to access the filesystem SafeFileHandle handle = SqlNativeClient.OpenSqlFilestream

Since WCF Data Services likes to play with Entity Framework or Linq-To-SQL who can be the streaming implementation and is there a support for the SQL Server Filestream Type?

this is the plan but I don't know how to assemble it together... I thougt about chunking the large files and to be able to resume and cancel.

For the upload: I am not sure to use the silverlight upload control or some other nifty ajax tool.

Can anyone point me in the right direction here... or would u think this is this a way to go? Thoughts, Links? whould be great...


I did something where I was sending huge data files. I used these two examples to help write my code

http://msdn.microsoft.com/en-us/library/ms751463.aspx

http://www.codeproject.com/KB/WCF/WCFDownloadUploadService.aspx

This is a very important number to know 2147483647


silverfighter: Only on IIS6, I could not configure WCF Data Services to send more than 30 MB Stream over the network. I believe it is not built for large stream transactions. Just try to upload a 27 MB file and monitor the relevant w3wp process, you will be surprised by the amount of memory consumed.

The solution was to create a WCF Service Application hosted under its own w3wp process and responsible only for download / upload over WCF. i recommend you use the following project http://www.codeproject.com/Articles/166763/WCF-Streaming-Upload-Download-Files-Over-HTTP

Hope the above could help.


Not Related to the question but related to answer of @Houssam Hamdan :

The 30 MB limit is not because of WCF data services but it's IIS's limitation that can be changed through config file and settings of IIS and catching some exceptions thrown by IIS

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜