Adding an attachment to the article in backend.js in the application

Hello!

I am developing an application with a widget. This widget opens on the article page and can change content of the article.

In the application's backend.js, I have the following code that allows me to change the content of the article:

if (response && response.code === 200) {
  ctx.article.content = response.response;
}

response is the result of executing connection.postSync

Please tell me, is there any way to upload an attachment to an article from backend.js in the application? Can I use the addAttachment method in the backend.js of the application?

0
1 comment

Hi Uolary!

You can certainly use the addAttachment method and all other methods and properties supported by ctx.article and ctx.currentUser.

If it's something you can share in a public forum, we'd love to learn more about your app! It sounds like you are implementing a very curious scenario :-)

0

Please sign in to leave a comment.