Each call of doc.GetContentStream goes to the repository and opens a stream. If you do that three times, you have three open connections. This might be the issue. I wouldn't call it bug but the documentation has to be improved.

- Florian



I had fix that. It's working now.
The problem was when code calls several times Doc.GetContentStream instead of storing in a IContentStream vble and obtain filename, mimetype and
stream.

This code works:
Dim cStream As Data.IContentStream = doc.GetContentStream
            repoDoc.FileName = cStream.FileName
            repoDoc.MimeType = cStream.MimeType
            repoDoc.Content = cStream.Stream


This code doesn't work
            repoDoc.FileName = doc.GetContentStream.FileName
            repoDoc.MimeType = doc.GetContentStream.MimeType
            repoDoc.Content = doc.GetContentStream.Stream

Maybe a bug in GetContentStream implementation?

Thank you.


2012/4/20 Florian Müller <[email protected]>

Hi José,

The stream is never a FileStream. Depending on the binding it is either a
MemoryStream or a BufferedStream.

- Florian




 Hi. I'm creating and fetching a document (plain txt) in Alfresco
Enterprise
3.3 with DotCMIS.

Creating document is OK. Alfresco shows the doc in the right folder and
the
content is right. But when I fetch the doc by ID and try to recover the stream the app blocks because the method call never returns. Can somboy
help me?

Source code:

   Dim id As Client.IObjectId = New Client.Impl.ObjectId(docId)
    Dim doc As Client.IDocument = TryCast(_sesion.GetObject(id),
Client.IDocument)

    repoDoc.Id = doc.Id // OK
           repoDoc.Name = doc.Name // OK
           repoDoc.FileName = doc.GetContentStream.FileName //OK
           repoDoc.MimeType = doc.GetContentStream.MimeType //OK
           repoDoc.Content = CType(doc.GetContentStream.**Stream,
FileStream) //Never returns.

           Return repoDoc





Reply via email to