Ok guys, this is a new feature which I came across while exploring BCS. BCS now supports getting BLOBs into SharePoint and provide many features which help in pulling and streaming BLOB's out to end user.
The work which I did on this has been published as a whitepaper courtsey to some folks in Redmond. Here is the link to published article:
Accessing BLOB Data from External Systems Using Business Connectivity Services in SharePoint Server 2010
Want to say thanks to Arpan, Michal Gideoni, Brad Stevenson, Juan Balmori Labra and Beck Andros for providing all the support to write this article.
can we update the BLOB data using any mechanism with external content type as we can do with metadata?
The StreamAccessor are meant for streaming BLOB's for reading. They can't update back. You can use normal updater methods to update back small amount of data where you can use byte as the data types.
There's no mention in the white paper of retrieving blob data from Windows Azure or SQL Azure, which is surprising when you consider Microsoft's cloud agitprop on the topic.
Is a similar white paper in the works for Windows Azure/SQL Azure?
I followed your article, except for replacing Word-Blobs with .EML files in the blob instead.
Everything works well when displaying the results in a Business data List Web part, and it shows the "Click here to download" etc.
But it will not Crawl the content.
I have 160 records with in my db-table, and the crawl log consistently crawls 10 of them with the following warning for each:
"This item comprises multiple parts and/or may have attachments. Not all of these parts were indexed. They may either be invalid or deliberately skipped (e.g. images). The remote server may also have been unresponsive while indexing these parts."
Any idea on what i do wrong?
The warning below is generally seen if the correct extension is not specified. One more thing to note is that the extension should be specified without a leading period (as eml and not .eml).
Can you also share your model file for me to analyze. Send to tejeshwers @ hotmail.com.
I've used your example but in my case I want to stream content from the file system. I got it all working but when I click the "Click here to download" link on the Item Profile Page I get the following message:
Failed to retrieve data from the External System: 'Error - No content exists for this field.'
I attached the debugger and stepped through the call and I can see that my System.IO.Stream object gets initialized correctly and has content so I'm not sure what's going on. Your specific example uses byte array as the return type but as far as I understand System.IO.Stream should be fine too.
I can email you my model xml if you'd like to review.
@Peter- Are you using web service, custom .NET shim to read the file stream? I havent tried with anything apart from DB but it should work.
Nice post. I'm having the same issue as that of Peter. When I try to stream the BLOB from web, I'm getting an exception saying "Failed to retrieve data from the External System: 'Error - No content exists for this field." This is my coding in the StreamAccessor method:
public static Stream GetMediaFile(string id)
string filePath = ReadItem(id).Url.Trim();
Uri fileUrl = new Uri(filePath);
HttpWebRequest myFileWebRequest = (HttpWebRequest)WebRequest.Create(fileUrl);
HttpWebResponse myFileWebResponse = (HttpWebResponse)myFileWebRequest.GetResponse();
Stream receiveStream = myFileWebResponse.GetResponseStream();
Do you have a solution for this?
Try to Seek the stream to start before you return in function. I think its at end due to GetResponseStream and hence fails when BCS tries to read from stream which is at end.
@tajeshwar singh : Same issue on my side, and seeking to start solve pbm ! many thanks for tips !