问题
I have been trying to find information regarding if it is possible to upload and download files using WCF Data Services (formerly ADO.NET Data Services), but haven't been able to make any leads due to perhaps less help content available on wcf data services on the web as of now.
Is it possible for us to write a wcf data service so that client can post to the following URI to upload a file - http://some-restfulwebservice/Files/upload
and this url to download the fie - http://some-restfulwebservice/File('XYZ.txt')/download
Any good examples/sample code? Any help or direction would be appreciated?
回答1:
Astoria supports something very much like this through something called Media Link Entries.
I am working on samples to help here at the moment, but it will take me a few more weeks probably
Check out IDataServiceStreamProvider in the meantime.
And check back on my Custom Data Service Providers series in a week or two.
Hope this helps
Cheers
Alex
Data Services Team - Microsoft.
来源:https://stackoverflow.com/questions/2042025/uploading-and-downloading-files-using-wcf-data-services