Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Reading from a text file

Avatar

Level 2

I have accomplished this before but can't for the life of me remember (or find) the code I used. I need to be able to read the contents of a .txt file and automatically populate a form's text field. It would be heplfull to beable to make changes to this field and have them saved in the text file also... but it is more important to be able to just read from the file. I know the document will likely have to be a "trusted" document to accomplish this and that's fine. What I am trying to accomplish is to have a text field that displays pager numbers that are used in other places in the form, these pager numbers change on occasion and I need a simple way for end users to be able to keep these updated. Another option would be to automatically save the contents of this single text fild without saving data in any other field. Is it possible to have the contents of just one field save without enabling extended features in adobe reader?

2 Replies

Avatar

Level 2

ok I figured out what I did... I just used the URL function GET() Very simple and it works for a URL but I can't get it to read a local file. Am I missing something?

using formcalc...

This works

var value = Get("http://domain.com/test.txt")

$.rawValue = value

This doesn't

var value = Get("C:\test.txt")

$.rawValue = value

Avatar

Level 7

I believe Adobe has built in restrictions against accessing the local hard drive of the machine the form is running on, hence web url's are fine but local references fail.