You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by Norbert Kopcsek <nk...@reppa.net> on 2011/10/28 18:14:14 UTC
CMIS/Alfresco: Canceling uploads creates documents with corrupted files
Hi again.
I'm not sure this is the proper Mailing List for this issue, but here it goes:
We have a project were we use OpenCMIS 0.5.0 to communicate to Alfresco using WebServices. We want to use the Streaming API of Apache Commons FileUpload (as described here: http://commons.apache.org/fileupload/streaming.html) to get the InputStream, create a ContentStream and send it directly to Alfresco using Folder.createDocument(...) to create new documents and Document.checkIn(...) to update documents.
When canceling an upload OpenCMIS rightly throws an exception informing about an end of file error, but still a new document is created in Alfresco containing a corrupted/partial file/contentstream. My expectation is that an EOFError should result in no creation of a document. This issue makes it impossible for us to use the Streaming API but instead we have to first store the stream into a file (this can be canceled) and then move it to Alfresco (cannot be canceled).
Thanks for any tips and hints or fixes for this issue.
Regards,
Norbert Kopcsek
nk@reppa.net
Re: CMIS/Alfresco: Canceling uploads creates documents with corrupted
files
Posted by Florian Müller <fl...@alfresco.com>.
Hi Norbert,
That's rather a general problem than an Alfresco problem. The repository can't know that the stream in incomplete. The stream just ends.
Do you have a stack trace or a code snippet to reproduce that?
- Florian
On 28/10/2011 09:14, Norbert Kopcsek wrote:
> Hi again.
>
> I'm not sure this is the proper Mailing List for this issue, but here it goes:
>
> We have a project were we use OpenCMIS 0.5.0 to communicate to Alfresco using WebServices. We want to use the Streaming API of Apache Commons FileUpload (as described here: http://commons.apache.org/fileupload/streaming.html) to get the InputStream, create a ContentStream and send it directly to Alfresco using Folder.createDocument(...) to create new documents and Document.checkIn(...) to update documents.
>
> When canceling an upload OpenCMIS rightly throws an exception informing about an end of file error, but still a new document is created in Alfresco containing a corrupted/partial file/contentstream. My expectation is that an EOFError should result in no creation of a document. This issue makes it impossible for us to use the Streaming API but instead we have to first store the stream into a file (this can be canceled) and then move it to Alfresco (cannot be canceled).
>
> Thanks for any tips and hints or fixes for this issue.
>
> Regards,
> Norbert Kopcsek
> nk@reppa.net
>
>
>