Transfer files via ODATA
Solution 1
There's a great walkthrough here: https://devblogs.microsoft.com/odata/data-services-streaming-provider-series-implementing-a-streaming-provider-part-1/ and then https://devblogs.microsoft.com/odata/data-services-streaming-provider-series-part-2-accessing-a-media-resource-stream-from-the-client/.
It describes a way to expose streams based on an EF provider. There's also a way to upload the stream to the server. Note that there's nothing "OData" about the streams as such. The sample above just uses OData as the metadata for the streams and uses simple REST to get and/or upload the stream.
Solution 2
Since you can save and retrieve binary data to/from a database and Edm.Binary
is supported by the data model this should be possible. You could save your file in binary format in a database column and then expose it through your model and the OData API.
Related videos on Youtube
Comments
-
gosua almost 2 years
Is it possible to transfer files via an ODATA service? when there is a possibility, how could i do that?
I already searched a lot on the internet but i couldnt make it to find a proper example.
-
Lea Cohen about 12 yearsCould you list a few results that you have found during your search, and why they don't fit what you're looking for?
-