You should be more specific with your questions.
Using what? Java, .Net, WebService or Webtop?
Hi... Miklos Szurap....
I'm sorry, but I cannot help you, I don't have any experience with .NET C#...
Dont worry....
Hi,
I need some urgent help, i want to know how can i download a file from centera if i know the clip id.
I am able to upload the files using .net api but not sure how to download.
Please help
public byte[] GetFileToDocumentum(string documentumId) { DataPackage dataPackage = null; DataObject dataObject = null; Content contentObj = null;
try { dataPackage = GetDataPackage(documentumId);
dataObject = dataPackage.DataObjects[0];
contentObj = dataObject.Contents[0]; } catch (Exception ex) { throw ex; }
return contentObj.GetAsByteArray(); }
private DataPackage GetDataPackage(string documentumId) { ObjectIdentity objectIdentity = new ObjectIdentity(new ObjectId(documentumId), _repository);
ObjectIdentitySet objectIdentitySet = new ObjectIdentitySet(); objectIdentitySet.AddIdentity(objectIdentity);
DataPackage dataPackage = null;
try { PropertyProfile propertyProfile = new PropertyProfile(PropertyFilterMode.ALL); ContentProfile contentProfile = new ContentProfile(); OperationOptions operationOptions = new OperationOptions(); ContentTransferProfile contentTransferProfile = new ContentTransferProfile();
PermissionProfile permissionProfile = new PermissionProfile(); permissionProfile.PermissionTypeFilter = PermissionTypeFilter.ANY; operationOptions.PermissionProfile = permissionProfile;
contentTransferProfile.TransferMode = ContentTransferMode.MTOM; contentProfile.FormatFilter = FormatFilter.ANY; operationOptions.ContentTransferProfile = contentTransferProfile; operationOptions.PropertyProfile = propertyProfile; operationOptions.ContentProfile = contentProfile; operationOptions.SetProfile(contentProfile);
dataPackage = objectService.Get(objectIdentitySet, operationOptions); } catch (Exception ex) { throw ex; }
return dataPackage; }
Hello,
we have used the same approach (DFS-Client with Java).The problem is here that your program will run into out of memory exceptions if the file is very big because it loads it completely into the memory as bytearray...
If you will have ACS configured on the content server, you can stream your content from the methodserver to your client (see example) and you are able to stream it into a file.
Example:
content = objectContentSet.getContents().get(0); InputStream contentStream = null; if (content instanceof UrlContent) { UrlContent urlContent = (UrlContent) content; try { URL acsContentUrl = new URL(urlContent.getUrl()); contentStream = acsContentUrl.openStream();
// do whatever with the stream...
...
We use that approach to stream the content directly to the browser so that the user can download the file without saving the content on the web application server...
I hope, this helps you.
Thanks,
Jens
hi gcamou
i am looking foe a sample file which can help me in downloading file from documentum kindly help
i am stuck in this problem for more then a weak and i have verry less time
kindly help me by providing a sample code to do this work"download file from documentum to local drive" in .net C#
thanks