I try to make the request with http://localhost:8080/share/proxy/alfresco/api/upload with this:
function getResponse(pdfbase64) {
var csrf_header = Alfresco.util.CSRFPolicy.getHeader();
var csrf_token = Alfresco.util.CSRFPolicy.getToken();
var fd = new FormData();
if (Alfresco.util.CSRFPolicy && Alfresco.util.CSRFPolicy.isFilterEnabled())
{
fd.append(csrf_header, csrf_token);
fileUpdateURL += "?" + Alfresco.util.CSRFPolicy.getParameter() + "=" + encodeURIComponent(Alfresco.util.CSRFPolicy.getToken());
}
fd.append("username", "admin");
fd.append("updatenoderef", nodeRef);
fd.append("filedata", pdfbase64);
fd.append("majorversion", "true");
fd.append("overwrite", "true");
alert(fileUpdateURL);
$.ajax({
url: fileUpdateURL,
type: "POST",
data: fd,
processData: false, // tell jQuery not to process the data
contentType: false // tell jQuery not to set contentType
});
}
The variable pdfbase64
is the content to put on the file (the changes that I made on the file to update the file in base64), but maybe this isn't the right format?, nodeRef
is the reference of the file like: "workspace://SpacesStore/4fb1b7e7-2502-4011-8870-17e8d626b93b"
and fileUpdateURL
is the URL
to POST
: http://localhost:8080/share/proxy/alfresco/api/upload
But I obtain the error:
{ "status" : { "code" : 400, "name" : "Bad Request", "description" : "Request sent by the client was syntactically incorrect." }, "message" : "Required parameters are missing", "exception" : "", "callstack" : [ ], "server" : "Community v5.0.0 (d r99759-b2) schema 8,022", "time" : "Jan 24, 2016 1:14:41 PM" }
Can you help me?
--
You received this message because you are subscribed to the Google Groups "Alfresco Technical Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alfresco-technical-d...@googlegroups.com.
To post to this group, send email to alfresco-techn...@googlegroups.com.
Visit this group at https://groups.google.com/group/alfresco-technical-discussion.
For more options, visit https://groups.google.com/d/optout.
Regards,Sujay Pillai
To unsubscribe from this group and stop receiving emails from it, send an email to alfresco-technical-discussion+unsub...@googlegroups.com.