I am using DFS 6.5sp2, .NET productivity layer. I am using the following code to get the content url and return it to the client:
// Get the version to retrieveQualification qualification = new Qualification("adp_document (ALL) where ANY r_version_label = " +
"'" + version + "' and r_object_id = '" + docId + "'");
ObjectIdentity objectIdentity = new ObjectIdentity(qualification, Repository);
ObjectIdentitySet objectIdentitySet = new ObjectIdentitySet(objectIdentity);
ContentProfile contentProfile = new ContentProfile();contentProfile.FormatFilter =
FormatFilter.ANY;contentProfile.UrlReturnPolicy =
UrlReturnPolicy.ONLY;
OperationOptions operationOptions = new OperationOptions();operationOptions.ContentProfile = contentProfile;
operationOptions.SetProfile(contentProfile);
DataPackage dataPackage = objectService.Get(objectIdentitySet, operationOptions);
Content content = dataPackage.DataObjects[0].Contents[0];
UrlContent urlContent = (UrlContent)content;
// Encode the url to prevent changes when DataSet is converted to xml
url = System.Web.HttpUtility.UrlEncode(urlContent.Url);
ContentTransferProfile is set to return MTOM (binary) data. When the url is clicked on the client, the document will open in the browser if the application is on the client pc. If the client does not have an application for the associated type (visio vsd, for example), the binary data is streamed out to the browser window. What should happen is the browser should throw up a message box stating that the format is not recognized and would the client like to open or save the file to the machine.
Am I missing something here? As I said, document types that the client has are displayed appropriately.
Thanks.