AnsweredAssumed Answered

Alfresco upload new version of file exact json request

Question asked by koopa on Jul 3, 2014
I'm trying to upload a file to a site document library via Chrome Postman. If I use the Postman normal form (form-data) it's ok but I'd like to use the raw one because I need the file-reference to be saved, and unfortunately Postman can't save reference to File data inside normal request form (form-data) due to <a href="http://www.getpostman.com/docs/requests">HTML5 issues</a>.
So I tried to use a request body that could do the job but with no luck. By the way, I'd also like to upload new version of the file with consecutive calls, not to upload a new one with the suffix "-1", "-2", the overwrite param seems not to work.
This is my raw request body:
<javascript>
{
  "filedata"="filename:'path\info.txt' Content-Type:text/plain",
  "siteid"="repository",
  "containerid"="documentLibrary",
  "description"="new version",
  "content-type"="cm:content",
  "filename"="info.txt",
  "overwrite"="true"
}
</javascript>

and this is my post request:
http://localhost:8080/alfresco/service/api/upload?alf_ticket=TICKET_blablabla


The error response is:

{
    "status": {
        "code": 500,
        "name": "Internal Error",
        "description": "An error inside the HTTP server which prevented it from fulfilling the request."
    },
    "message": "06030014 Unexpected error occurred during upload of new content.",
    "exception": "org.springframework.extensions.webscripts.WebScriptException - 06030014 Unexpected error occurred during upload of new content.",
    "callstack": [
        "",
        "org.mozilla.javascript.JavaScriptException: [object Error] (file:/C:/Users/stefano_lazzaro/stefano/progs/alfresco-4.2.b/tomcat-repo/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/upload/upload.post.js#373)",
        "org.mozilla.javascript.gen.c40._c3(file:/C:/Users/stefano_lazzaro/stefano/progs/alfresco-4.2.b/tomcat-repo/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/upload/upload.post.js:373)",
      …
        "org.springframework.extensions.webscripts.WebScriptException: 06030014 Unexpected error occurred during upload of new content.",
        "org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1053)"
    ],
    "server": "Community v4.2.0 (4480) schema 6.020",
    "time": "3-lug-2014 16.22.55"
}


how can I change my request body to get through?

Outcomes