Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

How to read multiple documents from a system directory?

_hussam_
Level 3
Level 3

Hi,

I'm trying to read multiple documents from a specific folder that contains pdfs, jpgs... the only activity I found is the Read Document, but this activity does not have the option to read all docs under my folder!.

so any one can tell me if there is another activity can do it or is there any good solution to loop on the folder and read all the docs? any script will be helpful.

Thanks

Hussam

5 Replies
_hussam_
Level 3
Level 3

Hi,


After many hours of searching and readings, I found a solution, I do not know if it is the best, but  anyhow this is my solution:
By using a service operation called "Find" from a service named "FileUtilsService", this operation will return a list of strings with the names of all files and/or directories under the path you want.
Then by using the "Read Document"  I was able to get one file and store it in a dcoumnet variable, and by using a simple looping technique I got all  the files I want.

hope this will help others

Hussam

Hodmi
Level 8
Level 8

A while ago I needed the same thing, so I wrote up a bit of java code as a DSC for LiveCycle.   I read the directory into a list of documents so it can be used later on.

There is also an operation to read file from a URL and to convert a Document into a byte array.

Source code and workbench deployable DSC jar file are attached.

Please note that this is unofficial and not supported by Adobe in any way.

Mark_Lindberg
Level 5
Level 5

Hodmi:

Is this component built for ES, or ES2?

Does it matter?

Thanks

Mark

Hodmi
Level 8
Level 8

I built it for ES, but I have used it with ES2 and ES2.5 with no problems.  Its really just a wrapper on some simple java code.

_hussam_
Level 3
Level 3

Thank you Hodmi,

I'll download it, In Sha2 Allah, and test it

Hussam