11-12-2017 03:35 PM
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
11-14-2017 03:33 AM
The upload webscript expects HTML form data. Have you tried specifying the Content-Type as application/x-www-form-urlencoded?
Explore our Alfresco products with the links below. Use labels to filter content by product module.