Upload a text document to a folder in Alfresco seems not working using Rest API. I have a site named R02, under documentLibrary has a folder bank1. I am using Postman rest client tool.
Header: Authorization: [{"key":"Authorization","value":"Basic YmlsbHd5dWFuQHlhaG9vLmNvbToxMjM0eXVhbg==","description":""}]
Request body
{
"filedata":"any text",
"filename": "test1.txt"
"description": "example"
"siteid":"r02",
"containerid":"documentlibrary" ,
'uploaddirectory': 'bank1'
}
also tried:
{
"filedata": "textxxxxxl",
"filename": "test1.txt",
"description": "example",
"siteid": "r02",
"containerid": "508440fc-1578-45a5-b4f7-87eb5ea6f40a"
}
and
{
"filedata": "@test.txt",
"filename": "abc.text",
"siteid": "r02",
"containerid": "workspace:\/\/SpacesStore\/99c6f662-242f-4917-85bb-ae5a9b8454e8"
}
In response, it always return 502 bad gateway. I also tried a community edition 5.0.d. Not success. Does anyone see the problem I have?
thank you very much!
Bill
The upload webscript expects HTML form data. Have you tried specifying the Content-Type as application/x-www-form-urlencoded?
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.