04-24-2009 01:06 AM
POST /service/api/uploadwith the request body attached below.for each (field in formdata.fields) {
status.message += " " + String(field.name);
}
POST /service/api/upload
Content-Type: multipart/form-data; boundary=3673886725790367917
—3673886725790367917
Content-Disposition: form-data; name="containerid"
26a0569c-c056-4997-bbb4-67f81ec6695b
—3673886725790367917
Content-Disposition: form-data; name="nodeid"
26a0569c-c056-4997-bbb4-67f81ec6695b
—3673886725790367917
Content-Disposition: form-data; name="ticket"
TICKET_8950a48fe1117b4c32f359a06c514bd4c4f70d7c
—3673886725790367917
Content-Disposition: form-data; name="title"
test2.txt
—3673886725790367917
Content-Disposition: form-data; name="filename"
test2.txt
—3673886725790367917
Content-Disposition: form-data; name="siteid"
localhost
—3673886725790367917
Content-Disposition: form-data; name="submit"
Upload
—3673886725790367917
Content-Disposition: form-data; name="filedata"; filename="c:\test2.txt"
Content-Type: text/plain
[actual content here]
—3673886725790367917
04-24-2009 10:02 AM
04-29-2009 03:34 AM
11-04-2009 06:09 PM
POST /alfresco/service/traqsAPI/testUpload?alf_ticket=TICKET_……………………ad61da HTTP/1.1
The headers are:
Content-Type: multipart/form-data; boundary=BEACF86DE59B48bbB49F82CB55A3D009
Host: alfrescoserver:8080
Content-Length: 336
Expect: 100-continue
–BEACF86DE59B48bbB49F82CB55A3D009
Content-Disposition: form-data; name="test"
This is a test value.
–BEACF86DE59B48bbB49F82CB55A3D009
Content-Disposition: form-data; name="filedata"; filename="filename.xml"
Content-Type: text/xml
<h3>Heading</h3><p>This is some text for the test.</p>
–BEACF86DE59B48bbB49F82CB55A3D009
<response>
<status>
404
<name>Not Found</name>
<description>Requested resource is not available.</description>
</status>
<message>No content was supplied in the request. Field names found were ''</message>
<exception></exception>
<callstack>
</callstack>
<server>Alfresco Community v3.2.0 (2039) schema 2,019</server>
<time>04-Nov-2009 22:16:30</time>
</response>
function main(){
// Get values from form data.
var filename = null;
var content = null;
var mimetype = null;
var test = null;
// Parse file attributes
var fieldNames = "";
for each (field in formdata.fields) {
fieldNames = fieldNames + field.name + " ";
switch (String(field.name).toLowerCase()) {
case "filedata":
if (field.isFile) {
filename = field.filename;
content = field.content;
mimetype = field.mimetype;
}
break;
case "test":
test = field.value;
break;
}
}
if(content == null){
status.code = 404;
status.message = "No content was supplied in the request. Field names found were '" + fieldNames + "'";
status.redirect = true;
return;
}
…snipped…
}
main();
11-06-2009 07:44 AM
–BEACF86DE59B48bbB49F82CB55A3D009–
instead of
–BEACF86DE59B48bbB49F82CB55A3D009
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.