• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Using vv_out to download IFS stream file in ASCII text format

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using vv_out to download IFS stream file in ASCII text format

    Want to build a self service web app with NAB to allow users to select and download 80 column ASCII text files already created in an IFS directory /usr/local/myDownloads. Files are encoded in CCSID 1252 and I want them transferred as is (binary mode)

    vvOut.download = '1';
    vvOut.file = 'myFile80.txt';
    vvOut_file('/usr/local/myDownloads/myFile80.txt':vvOut);

    Just want to confirm that the IFS path is absolute and doesn't require an alias in the web server configuration

  • #2
    That is correct, the IFS path is absolute.

    Comment


    • #3
      Almost there. Can display the list of available files in the directory, click on the grid item, text file transfers via the browser download mechanism, BUT..

      getting this appended to the end of the source file:

      Cache-Control: no-cache
      Content-type: application/json

      {"success" : true , "info" : "Download ISOLOS1221.txt" }

      Running Valence Framework 6.1.20220405.1

      Comment


      • #4
        Assuming that you are using the EXNABBTN base template, correct? If that is the case, you must have a couple of SetResponse procedure calls running after your call to vvOut_file.

        Comment


        • #5
          Correct. Should I change the order of execution?

          Code:
           path_name = getselectionCHAR(1:'PATH_NAME');
          file_name = getselectionCHAR(1:'FILE_NAME');
          
          vvOut.download = '1';
          vvOut.file = %trim(file_name);
          vvOut_file(%trim(path_name):vvOut);
          //
          SetResponse('success':'true');
          SetResponse('info':'Download ' + %trim(file_name));

          Comment


          • #6
            Since you're streaming a file, you should just remove the SetResponse lines altogether.

            Comment


            • #7
              Issue resolved. Thank you.

              Comment

              Working...
              X