<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to assign a mimetype to document being created using REST API? (Alfresco 5.2) in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-assign-a-mimetype-to-document-being-created-using-rest/m-p/63505#M21808</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot set mime type when uploading, as it's autodetected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you find any case where this detection process fails, you can modify mime type after uploading the content.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 Jun 2018 08:26:29 GMT</pubDate>
    <dc:creator>angelborroy</dc:creator>
    <dc:date>2018-06-02T08:26:29Z</dc:date>
    <item>
      <title>How to assign a mimetype to document being created using REST API? (Alfresco 5.2)</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-assign-a-mimetype-to-document-being-created-using-rest/m-p/63504#M21807</link>
      <description>hi,I am wondering if there is anyway we can set/assign the content-mime type of a document being created using REST API.I use the below this rest api&amp;nbsp; and I need to be able to set mimetype directly when the document is being created.&amp;nbsp;Is that possible?I did a few try and errors it seems that mimetype</description>
      <pubDate>Fri, 01 Jun 2018 17:26:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-assign-a-mimetype-to-document-being-created-using-rest/m-p/63504#M21807</guid>
      <dc:creator>mikeitexpert</dc:creator>
      <dc:date>2018-06-01T17:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign a mimetype to document being created using REST API? (Alfresco 5.2)</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-assign-a-mimetype-to-document-being-created-using-rest/m-p/63505#M21808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot set mime type when uploading, as it's autodetected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you find any case where this detection process fails, you can modify mime type after uploading the content.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Jun 2018 08:26:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-assign-a-mimetype-to-document-being-created-using-rest/m-p/63505#M21808</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2018-06-02T08:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign a mimetype to document being created using REST API? (Alfresco 5.2)</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-assign-a-mimetype-to-document-being-created-using-rest/m-p/63506#M21809</link>
      <description>&lt;P&gt;Can you give a example for this ?&lt;/P&gt;&lt;P&gt;I have tried this:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;FormData data = new FormData();&lt;/SPAN&gt;&lt;BR /&gt;data.addFieldData("prop_mimetype", mimetype, true);
Item itemMimetype = new Item("node", nodeRef.toString());
NodeRef nodeRefFoundedUpdated = (NodeRef)formService.saveForm(itemMimetype, data);&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;and this:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;ContentWriter contentWriter = &lt;SPAN&gt;contentService.getWriter(nodeRef, ContentModel.PROP_CONTENT, true);&lt;/SPAN&gt;
if(contentWriter != null) {
	contentWriter.setMimetype(mimetype);
}&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;but is not working is still a "application/octet-stream" value on alfresco share&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 04 Jun 2024 08:56:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-assign-a-mimetype-to-document-being-created-using-rest/m-p/63506#M21809</guid>
      <dc:creator>AlfrescoZZZ</dc:creator>
      <dc:date>2024-06-04T08:56:39Z</dc:date>
    </item>
  </channel>
</rss>

