jpotts/alfresco-api-python-examples

Unable to upload documents to Alfresco CMIS

vijayr1912 opened this issue · 0 comments

Hi I am trying to load documents into Alfreso CMIS and I am getting this following error-

Python 3

from cmislib.model import CmisClient

FILE = '/home/monu/Fair-Work-Information-Statement.pdf'
file = open(FILE, 'rb')
fileName = file.name.split('/')[-1]
doc = None
FILE_TYPE = 'application/pdf'

try:
    doc = archive_folder_2.createDocument(str(fileName), contentFile=file, contentType=str(FILE_TYPE))
    print(f'Create Document { doc.id}')
except Exception as e:
    print(e)
    
file.close()

ERROR - 'bytes' object has no attribute 'encode'

Python 2.7

ERROR - Unable to parse non-GMT values at this stage

Not able to understand what is exactly wrong, as even .txt files are not getting uploaded. Can you help me to understand this error. Any hint would be highly appreciated. I am working on Mac OS.