06-16-2011 07:44 AM
06-27-2011 07:36 AM
var filename = null;
var content = null;
var title = "";
var description = "";
var myProp = "";
for each (field in formdata.fields)
{
//yourprop
if(field.name == "customer:myProp") {
myProp = field.value;
}
else if (field.name == "title")
{
title = field.value;
}
else if (field.name == "desc")
{
description = field.value;
}
else if (field.name == "file" && field.isFile)
{
filename = field.filename;
content = field.content;
}
}
// ensure mandatory file attributes have been located
if (filename == undefined || content == undefined)
{
status.code = 400;
status.message = "Uploaded file cannot be located in request";
status.redirect = true;
}
else
{
// create document in company home for uploaded file
upload = companyhome.createFile("upload" + companyhome.children.length + "_" + filename) ;
upload.properties.content.write(content);
upload.properties.content.mimetype = "UTF-8";
upload.properties.title = title;
upload.properties.description = description;
//your Prop here
upload.properties["customer:myProp"] = myProp;
upload.save();
// setup model for response template
model.upload = upload;
}
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.