<?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 Upload new version with 'mimeType': 'application/binary' in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/upload-new-version-with-mimetype-application-binary/m-p/145281#M38522</link>
    <description>&lt;P&gt;Hello everybody.&lt;/P&gt;&lt;P&gt;I want to upload a signed pdf as a new version of an unsigned pdf. I encode the pdf in binary utf-8 and send it through &lt;A href="https://docs.alfresco.com/content-services/5.2/develop/rest-api-guide/folders-files/#uploadnewversionfile" target="_self" rel="nofollow noopener noreferrer"&gt;the API to upload new version of a file.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Whenever I do so, I end up erasing the cryptography of the signature. Also I get these mimetypes:&lt;/P&gt;&lt;PRE&gt; 'application/pdf',&lt;BR /&gt;'mimeTypeName': 'Adobe PDF Document'&lt;/PRE&gt;&lt;P&gt;When I upload it as a new document, I maintain the cryptography of the signature and get the following mimetype:&lt;/P&gt;&lt;PRE&gt;'mimeType': 'application/binary'&lt;/PRE&gt;&lt;P&gt;I'm using this code in python:&lt;/P&gt;&lt;PRE&gt;url = alf_url + 'alfresco/api/-default-/public/alfresco/versions/1/nodes/' + \
    nodeId + '/content?majorVersion=true&amp;amp;name=filename.pdf"

headers = {"Authorization": "Basic " + ticket64,
           "Accept": "application/json",
           "Content-Type": "application/binary"}

files = {'file': fileData}
resp = requests.put(url, headers=headers, files=files, verify=False)&lt;/PRE&gt;&lt;P&gt;I also tried with the CMIS library, but it doesn't have a function to upload new versions of a file.&lt;/P&gt;&lt;P&gt;I hope you can help me.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ignacio&lt;/P&gt;</description>
    <pubDate>Tue, 05 Apr 2022 02:01:34 GMT</pubDate>
    <dc:creator>idebonis</dc:creator>
    <dc:date>2022-04-05T02:01:34Z</dc:date>
    <item>
      <title>Upload new version with 'mimeType': 'application/binary'</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/upload-new-version-with-mimetype-application-binary/m-p/145281#M38522</link>
      <description>&lt;P&gt;Hello everybody.&lt;/P&gt;&lt;P&gt;I want to upload a signed pdf as a new version of an unsigned pdf. I encode the pdf in binary utf-8 and send it through &lt;A href="https://docs.alfresco.com/content-services/5.2/develop/rest-api-guide/folders-files/#uploadnewversionfile" target="_self" rel="nofollow noopener noreferrer"&gt;the API to upload new version of a file.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Whenever I do so, I end up erasing the cryptography of the signature. Also I get these mimetypes:&lt;/P&gt;&lt;PRE&gt; 'application/pdf',&lt;BR /&gt;'mimeTypeName': 'Adobe PDF Document'&lt;/PRE&gt;&lt;P&gt;When I upload it as a new document, I maintain the cryptography of the signature and get the following mimetype:&lt;/P&gt;&lt;PRE&gt;'mimeType': 'application/binary'&lt;/PRE&gt;&lt;P&gt;I'm using this code in python:&lt;/P&gt;&lt;PRE&gt;url = alf_url + 'alfresco/api/-default-/public/alfresco/versions/1/nodes/' + \
    nodeId + '/content?majorVersion=true&amp;amp;name=filename.pdf"

headers = {"Authorization": "Basic " + ticket64,
           "Accept": "application/json",
           "Content-Type": "application/binary"}

files = {'file': fileData}
resp = requests.put(url, headers=headers, files=files, verify=False)&lt;/PRE&gt;&lt;P&gt;I also tried with the CMIS library, but it doesn't have a function to upload new versions of a file.&lt;/P&gt;&lt;P&gt;I hope you can help me.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ignacio&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 02:01:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/upload-new-version-with-mimetype-application-binary/m-p/145281#M38522</guid>
      <dc:creator>idebonis</dc:creator>
      <dc:date>2022-04-05T02:01:34Z</dc:date>
    </item>
  </channel>
</rss>

