Skip to content

Can't create document with session.createDocument() #91

Description

@ngngoctrung1997

I can't create new document, whenever i try, the error source.on is not a function keep apear
My code:

async createECMDoc(data, fileName, fileType) {
			let docId;
			let session = new cmis.CmisSession(this.settings.CMIS_URL);
			session.setCredentials(this.settings.CMIS_USERNAME, this.settings.CMIS_PASSWORD)
				.loadRepositories()
				.then(function () {
					return session.createDocument("48bc5187-6d77-4980-bf0d-4ccdb0d822ff",
						"this is the document content",
						"test.txt");
				})
				.then(data => {
					this.logger.info("created document");
					docId = data.succinctProperties["cmis:objectId"];
				});
			return docId;
		}

My error:
TypeError: source.on is not a function
at DelayedStream.create (D:\8. Product\HAS Product\03-phat-trien-phan-mem\source\moleculer-template\node_modules\delayed-stream\lib\delayed_stream.js:33:10)
at CombinedStream.append (D:\8. Product\HAS Product\03-phat-trien-phan-mem\source\moleculer-template\node_modules\combined-stream\lib\combined_stream.js:45:37)
at FormData.append (D:\8. Product\HAS Product\03-phat-trien-phan-mem\source\moleculer-template\node_modules\isomorphic-form-data\node_modules\form-data\lib\form_data.js:68:3)
at CmisSession.http (D:\8. Product\HAS Product\03-phat-trien-phan-mem\source\moleculer-template\node_modules\cmis\dist\cmis.js:122:26)
at CmisSession.post (D:\8. Product\HAS Product\03-phat-trien-phan-mem\source\moleculer-template\node_modules\cmis\dist\cmis.js:160:25)
at CmisSession.createDocument (D:\8. Product\HAS Product\03-phat-trien-phan-mem\source\moleculer-template\node_modules\cmis\dist\cmis.js:405:25)
at D:\8. Product\HAS Product\03-phat-trien-phan-mem\source\moleculer-template\services\attachments.service.js:126:21
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions