Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
upload replicant
aces
This is more of a deployment issue:
I have an upload function which allows user to upload files to the server. The upload field is a replicant, but everytime I upload more than one file, the workflow only deploy the first file and not all the files that I upload. This is what I have on the apprPostProcess.ipl:
my $uploadfile = $pDCR->value('Additional.Uploads.Upload');
if ($uploadfile)
{
$task->AddFile("$uploadfile","Attach uploaded file to Job");
debug("uploadfile: $uploadfile");
}
It seems like I need to loop through each replicant. Does anyone know how I can approach this?
Find more posts tagged with
Comments
jbonifaci
I'm assuming you're using XMLnode? perldoc TeamSite::XMLnode will give you everything you need to know.
But, assuming your replicant is Uploads and Upload is the name of the field with the file name, the untested code below should be what you're looking for.
foreach my $uploadReplicant ($pDCR->get_node_list("Additional.Uploads"))
{
my $uploadfile = $uploadReplicant->value("Upload");
if ($uploadfile)
{
$task->AddFile("$uploadfile","Attach uploaded file to Job");
debug("uploadfile: $uploadfile");
}
}
Message Name.png
aces
THANK YOU. It is exactly what I am looking for.
One more question... When I open the template, the path to the upload files still exist in the DCR and every time I deploy it, it push those files to production again
Any way I can solve that?
Edited by aces on 12/11/03 02:47 PM (server time).