AnsweredAssumed Answered unable to get fields from formdata

Question asked by calebmei on Apr 24, 2009
Latest reply on Nov 6, 2009 by rpldcox
Hi there,

I apologize if this question was asked before, but I couldn't find similar question and answer from previous posts.

I am trying to use Java to upload content via,
POST /service/api/upload
with the request body attached below.

However, is unable to get any field from formdata. When I try to print all the fields in formdata using this,
for each (field in formdata.fields) {
        status.message += " " + String(;

There is no fields in the formdata.

My understanding is that this is not an authentication issue, because without alf_ticket, I am getting 401 error. This issue is also unlikely to be similar /service/sample/upload, which requires permission on the user from the subspace. This issue's script is located in tomcat directory.

Is there some special setting I need to set the header of the request?
Is there  a way for me to trace the issue on why alfresco is not passing the formdata to the
Anyone have similar issue?

Thanks in advance and really appreciate for any assistance.  :)


Here's the request body with multipart form:

POST /service/api/upload
Content-Type: multipart/form-data; boundary=3673886725790367917

Content-Disposition: form-data; name="containerid"

Content-Disposition: form-data; name="nodeid"

Content-Disposition: form-data; name="ticket"

Content-Disposition: form-data; name="title"

Content-Disposition: form-data; name="filename"

Content-Disposition: form-data; name="siteid"

Content-Disposition: form-data; name="submit"

Content-Disposition: form-data; name="filedata"; filename="c:\test2.txt"
Content-Type: text/plain

[actual content here]