3 Replies Latest reply: Jun 13, 2013 6:07 AM by Gonterman1201 RSS


    Gonterman1201 Community Member

      if i use this and run it in the console it does not work. stmData = util.readFileIntoStream("/Users/art5/Desktop/00055-000-13.xml");

      if i do the same thing but this  stmData = util.readFileIntoStream(); I get an open window and navigate to the proper file and it works.

      What am i missing about util.readFileIntoStream? Because when i give it a direct path it fails.

      Thanks. BG

        • 1. Re: util.readFileIntoStream
          Test Screen Name MVP

          Did you read the FULL description of the cDIPath parameter?

          • 2. Re: util.readFileIntoStream
            Gonterman1201 Community Member

            (optional) A device-independent path to an arbitrary file on the user's hard drive.

            This path may be absolute or relative to the current document.

            If not specified, the user is presented with the File Open dialog to locate the file.

            If the cDIPath parameter is specified, this method can only be executed in privileged

            context, during a batch or console event (or when the document is certified with a

            certificate trusted to execute "embedded high privileged JavaScript").

            ////////////////////////////////////////////////////////////////////////////////////////// //////////////

            I am using a trusted function app.trustedFunction

            with app.beginPriv():

            In your opinion having the user select the file is it the only possibility?

            Because I am interested in having it get there automatically.

            • 3. Re: util.readFileIntoStream
              Gonterman1201 Community Member

              I could not get this to work in X. But in XI I used the security(enhanced) settings and made privilages for my files. And it worked fine.