This is part of my code:
File fileUpload = new File("var/Załącznik 123")
assert fileUpload
def part = new RequestFilePart(fileUpload, "file")
def partList = new ArrayList<RequestFilePart>()
partList.add(part)
authenticatedRequestFactory
.createRequest(Request.MethodType.POST, "rest/api/content/" + page_id + "/child/attachment")
.addHeader("X-Atlassian-Token", "no-check")
.addHeader("charset","UTF-8")
.setFiles(partList)
.execute(new ResponseHandler<Response>() {
@Override
void handle(Response response) throws ResponseException {
if(response.statusCode != HttpURLConnection.HTTP_OK) {
//log.debug response.statusCode
//log.debug response.getResponseBodyAsString()
throw new Exception(response.getResponseBodyAsString())
}
}
})
Finally in confluence is created attachemnt about name: "Za??cznik 123".
How add to object RequestFilePart charset, or maybe, I schould add it other place?
BR,
Igor
Based on this bug, it looks like Atlassian won't be focusing on fixing it: https://jira.atlassian.com/browse/CONFSERVER-17041
Regards
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.