You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Florian Müller (JIRA)" <ji...@apache.org> on 2019/03/29 10:56:00 UTC

[jira] [Commented] (CMIS-1071) filename are not set correctly on setContentStream

    [ https://issues.apache.org/jira/browse/CMIS-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16804810#comment-16804810 ] 

Florian Müller commented on CMIS-1071:
--------------------------------------

The issue is probably here: [https://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/binding/HttpPortable.cs?revision=1799607&view=markup#l182]

The headers in {{content}} should be copied to {{request.Headers}} as well.

> filename are not set correctly on setContentStream
> --------------------------------------------------
>
>                 Key: CMIS-1071
>                 URL: https://issues.apache.org/jira/browse/CMIS-1071
>             Project: Chemistry
>          Issue Type: Bug
>          Components: portcmis
>    Affects Versions: PortCMIS 0.3.0
>            Reporter: wentao lu
>            Assignee: Florian Müller
>            Priority: Major
>
> When use setContentStream, it does not be able to set the "Content-Disposition" header for some reasons. Please see below http message:
> PUT /cmis/atom/myrepository/content?id=idd_5087C169-0000-C515-9FB6-06967D7BF1C1&changeToken=0&overwriteFlag=false HTTP/1.1
> User-Agent: Apache-Chemistry-PortCMIS/0.3
> Content-Type: plain/text; charset=utf-8
> Authorization: Basic ZWNtY2VhZG1pbjpEZXYxUGFzc3dvcmQ=
> Host: localhost:4001
> Cookie: JSESSIONID=NqDBh0uyDIVrJvW0verrXFETDy4u_4IqSnJyDN2DOmIAxOrT2qSe!1962713399
> Transfer-Encoding: chunked
> Expect: 100-continue
> 9
> BANANA!!!
> 0
>  
> When call setContentStream using DotCMIS, it is able to set the file name via "Content-Disposition" header.
> PUT /cmis/atom/myrepository/content?id=idd_3089C569-0000-CE17-9119-FAC31AF1A146&changeToken=0&overwriteFlag=true HTTP/1.1
> User-Agent: Apache Chemistry DotCMIS
> Content-Type: application/msword
> Content-Disposition: attachment; filename*=UTF-8''AER%20New%20Use%20Cases%20-%20Draft.docx
> Authorization: Basic ZWNtY2VhZG1pbjpEZXYxUGFzc3dvcmQ=
> Host: localhost:4001
> Cookie: JSESSIONID=GWfFiTPPl2s2LLYLIh5-gN82XaJZ5rk3wPQz4ORtnm2ADmQJXhpn!1962713399
> Transfer-Encoding: chunked
> Expect: 100-continue
> When reviewing the code, it looks like the issue occurred on line 156 of HttpPortable.cs
> request.Headers.TryAddWithoutValidation(header.Key, header.Value);
> request is HttpRequestMessage
> On DotCMIS, it use:
> conn.Headers.Add(header.Key, header.Value);
> conn is HttpWebRequest.
>  
> Another different I see between DotCMIS and PortCMIS is the "content-type" header,
> DotCMIS get what it is from mimetype, i.e. 
>     Content-Type: application/msword
> However PortCMIS automatically add "charset=utf-8" which not always we want, 
>     Content-Type: plain/text; charset=utf-8
> We'd like developer can control what's been set in the header, if they need to add "charset", they can do it:
> string mimetype = "text/plain; charset=UTF-8";   //or
> string mimetype2 = "text/plain";  
> contentStream.MimeType = mimetype;
>  
> Thanks
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)