BookmarkSubscribeRSS Feed
hasnasherin
Fluorite | Level 6

Hi SAS Community,

Requirement: I need to allow users to upload one or more Excel files directly from a SAS Visual Analytics report using a custom upload button.

The Excel files will all have the same metadata/structure. The uploaded data then needs to be processed and made available for use in the same VA report.

I am using SAS Viya LTS 2025.09.

I have tried implementing this using a Web Content object in the VA report, with a SAS Job Execution backend.

The single-file upload is working successfully. When the user selects one Excel file, the HTML form submits to SAS Job Execution, and the backend SAS code can access the uploaded file using _WEBIN_FILEURI and _WEBIN_FILENAME.

However, when I change the HTML file input to allow multiple files:

<input type="file"
       name="myfile"
       accept=".xlsx,.xls"
       multiple
       required>

the user can select multiple Excel files, but after clicking the upload/submit button, the SAS job does not execute and no SAS log is generated.

My requirement is for the number of files to be dynamic — for example, the user may upload 5, 10, 50, or more Excel files at once. I do not want to create a fixed number of file input fields.

Questions:

  1. Is dynamic multiple Excel file upload supported from a Web Content object in SAS Visual Analytics using SAS Job Execution?

  2. If yes, what is the recommended HTML and SAS approach for handling multiple uploaded files?

  3. How can the multiple uploaded files be accessed in the SAS backend and combined into a single SAS dataset?

  4. Is there a recommended alternative architecture for achieving this requirement if the standard Web Content/Job Execution approach does not support multiple file selection?

Any guidance or examples would be greatly appreciated.

3 REPLIES 3
pathew
SAS Employee

It should be supported, why no log is generated is another question.
When multiple files are uploaded the Job provides numbered macro variables (like _webin_fileuri, _webin_filename).
For example uploading 3 files, file1.txt, file2.txt, file3.txt

 _WEBIN_CONTENT_LENGTH=0
 _WEBIN_CONTENT_LENGTH_COUNT=3
 _WEBIN_CONTENT_LENGTH0=3
 _WEBIN_CONTENT_LENGTH1=0
 _WEBIN_CONTENT_LENGTH2=0
 _WEBIN_CONTENT_LENGTH3=0
 _WEBIN_CONTENT_TYPE=text/plain
 _WEBIN_CONTENT_TYPE_COUNT=3
 _WEBIN_CONTENT_TYPE0=3
 _WEBIN_CONTENT_TYPE1=text/plain
 _WEBIN_CONTENT_TYPE2=text/plain
 _WEBIN_CONTENT_TYPE3=text/plain
 _WEBIN_FILE_COUNT=3
 _WEBIN_FILEEXT=txt
 _WEBIN_FILEEXT_COUNT=3
 _WEBIN_FILEEXT0=3
 _WEBIN_FILEEXT1=txt
 _WEBIN_FILEEXT2=txt
 _WEBIN_FILEEXT3=txt
 _WEBIN_FILENAME=file2.txt
 _WEBIN_FILENAME_COUNT=3
 _WEBIN_FILENAME0=3
 _WEBIN_FILENAME1=file2.txt
 _WEBIN_FILENAME2=file3.txt
 _WEBIN_FILENAME3=file1.txt
 _WEBIN_FILEURI=/files/files/132c1174-3a5a-40fd-acde-90a5d2ee6026
 _WEBIN_FILEURI_COUNT=3
 _WEBIN_FILEURI0=3
 _WEBIN_FILEURI1=/files/files/132c1174-3a5a-40fd-acde-90a5d2ee6026
 _WEBIN_FILEURI2=/files/files/c0eb5925-ca81-4c2e-a7ad-3b86314bab54
 _WEBIN_FILEURI3=/files/files/6b765f7a-fadd-489c-aff4-29d340c5779f
 _WEBIN_NAME=myfile
 _WEBIN_NAME_COUNT=3
 _WEBIN_NAME0=3
 _WEBIN_NAME1=myfile
 _WEBIN_NAME2=myfile
 _WEBIN_NAME3=myfile

Note the _WEBIN_NAME_COUNT macro variable, based on that one you can build your logic.
something like this:
%IF &_webin_name_count > 1 %THEN %DO <path for multiple files; use _webin_fileuri{n}> %END
%ELSE %DO <path for single file; use _webin_fileuri> %END

hasnasherin
Fluorite | Level 6
Thank you for the clarification. I understand that multiple file uploads are supported and that _WEBIN_NAME_COUNT can be used to handle single vs. multiple files.

My issue is that when I add the multiple attribute, no Job Execution log is generated at all. With a single file, the same form works correctly.

Could you please suggest what I should check to determine why the multiple-file request is not reaching Job Execution?
pathew
SAS Employee

A place to start is checking the developer tools of the browser, the console and network tabs, if you spot an error there. If you it does not reach the Job Execution it could well be a client issue.
Then you could check if it has something to do with upload size, do you encounter the same issue if you upload two very small files etc. Also try to exclude Visual Analytics, run the job outside of VA in a new browser tab. 

Next step would be to check job monitoring in Environment Manager, maybe you can find an error there. Then kubernetes pod logs.

 

I would suggest to reach out to SAS Technical Support, as I think the investigation might require some back and forth and probably an exchange of logs.

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 187 views
  • 0 likes
  • 2 in conversation