How to display incoming files from a folder?

Post Reply
lovestjarna
Newbie
Posts: 18
Joined: Mon May 26, 2014 3:50 pm

How to display incoming files from a folder?

Post by lovestjarna »

I have a folder with a lot of different file types being uploaded. I have sorted out the PDF but I would like to send a mail with all the other files just like a list like this:



- - - - - - - - - - - - - - - - - - - - - - - -



These files have been uploaded to your server:

image1.png

image2.jpg

textdocument.txt

photo4.tif



- - - - - - - - - - - - - - - - - - - - - - - -



Also want it to batch the files - not an email for every file...

I tried to use the "Assemble job" and set the value "After N minutes" to "2" and then the "Orphan timeout (minutes) to "3". So if there are no new files within 2 minutes it collect those into the email.

(If Im thinking right).



Or does anyone else having any other good examples on this?



Best regards
freddyp
Advanced member
Posts: 1023
Joined: Thu Feb 09, 2012 3:53 pm

How to display incoming files from a folder?

Post by freddyp »

[Job.NestedName] will give you a list of all the files in the job folder after the Assemble job. If there are subfolders the formatting may not be what you want and you may have to revert to a script expression. Try {Job.NestedName] first to see if it suits your needs.



Freddy
lovestjarna
Newbie
Posts: 18
Joined: Mon May 26, 2014 3:50 pm

How to display incoming files from a folder?

Post by lovestjarna »

Well. It is almost ok...

I got this message like this:



------------------------------

Files uploaded…



Job001;• testfile1.jpg;• testfile2.jpg;• testfile3.jpg;• testfile4.jpg





Email was triggered by this folder :

Job001

testfile1.jpg

testfile2.jpg

testfile3.jpg

testfile4.jpg

------------------------------



Now I have set the "Indent" to "• ". But they all come on one line... I would prefer them on one row for each file. I have tried a few "Actions" and also tried "", "r" and "nr" without working.

The last bottom of the message is something that is pre-built from Enfocus and lists them on sinlge rows...



Also... is it possible to rename jobfolder to date instead?
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

How to display incoming files from a folder?

Post by dkelly »

here's a script expression to grab the names of files in a job folder and return them as a message that could be used with Email body property.



var b = "The following files have been uploaded to the servernn";

var d = new Dir(job.getPath());

var e = d.entryList("*", Dir.Files|Dir.NoDotAndDotDot, Dir.Name);

for (var i=0;i<e.length;i++)

b += e + "n";

b;
lovestjarna
Newbie
Posts: 18
Joined: Mon May 26, 2014 3:50 pm

How to display incoming files from a folder?

Post by lovestjarna »

Hm, Im not sure where in the process to put that expression...

Should it be on the "send email" or on the folder before that and include body text to the email?

Tried both but got errors.
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

How to display incoming files from a folder?

Post by dkelly »

Sorry, I had a typo in my example. Fixed
Post Reply