Basic User cannot upload file into folder until adding him into administrator group

NOTE: PLEASE SEE MY LATEST UPDATES ON MY ISSUE ON THE COMMENT SECTION.

Hi every one, not sure if you have experienced this before:

The given requirement is to create an interface with a file upload field. With that file,check if the file format is csv, and if all the columns's header name are the right name and are in the right order). 

My code is attached below. The issue is that when the basic user's account is given viewer permission in my document folder, the file was not uploaded succesfully to the folder. If you have any recommendation please reach out. Thank you Slight smile

 

a!localVariables(
  local!document,
  local!uploadSuccess,
  local!correctFileFormat,
  a!fileUploadField(
    label: "File",
    target: cons!INCOMMing_DOCUMENTS,
    maxSelections: 1,
    value: local!document,
    saveInto: {
      a!save(local!uploadSuccess, false),
      local!document,
      if(
        a!isNullOrEmpty(local!document),
        {},
        a!submitUploadedFiles(
          onSuccess: {
            a!save(local!uploadSuccess, true),
            a!save(
              local!correctFileFormat,
              a!localVariables(
                local!validCSV: difference(
                  upper(document(ri!uploadFile, "extension")),
                  "CSV"
                ) < 0,
                if(
                  local!validCSV,
                  a!localVariables(
                    local!extractFile: previewcsvforimport(
                      document: ri!uploadFile,
                      delimiter: ",",
                      charset: "UTF-8",
                      numberOfRows: 6
                    ).data,
                    local!nullFile: a!isNullOrEmpty(local!extractFile),
                    local!previewFile: if(
                      local!nullFile = true,
                      null,
                      local!extractFile[1]
                    ),
                    and(
                      local!nullFile = false,
                      exact(
                        stripwith(upper(local!previewFile[1]), "/ (),."),
                        upper(
                          stripwith("File Name / Message ID", "/ (),.")
                        )
                      ),
                      exact(
                        stripwith(upper(local!previewFile[2]), "/ (),."),
                        upper(stripwith("Service", "/ (),."))
                      ),
                      exact(
                        stripwith(upper(local!previewFile[3]), "/ (),."),
                        upper(stripwith("Type", "/ (),."))
                      ),
                      exact(
                        stripwith(upper(local!previewFile[4]), "/ (),."),
                        upper(stripwith("Date Received", "/ (),."))
                      ),
                      exact(
                        stripwith(upper(local!previewFile[5]), "/ (),."),
                        upper(stripwith("Status", "/ (),."))
                      )
                    )
                  ),
                  false
                )
              )
            )
          },
          onError: a!save(local!uploadSuccess, false),
          documents: local!document
        )
      )
    },
    required: true(),
    validations: a!localVariables(
      local!invalidExtensions: difference(upper(fv!files.extension), "CSV"),
      if(
        length(local!invalidExtensions) > 0,
        "Attachments must be csv files. Please remove: " & index(fv!files, "name", {}),
        if(
          and(
            a!isNotNullOrEmpty(local!document),
            local!correctFileFormat = false
          ),
          "Please upload a file following required format",
          ""
        )
      )
    )
  )
)

  Discussion posts and replies are publicly visible