# Setting up multi file selections using the DOSFileLookup template

**URL:** <https://clarionhub.com/t/setting-up-multi-file-selections-using-the-dosfilelookup-template/7759>\
**Category:** questions\
**Created:** [December 19, 2024, 2:24pm UTC](https://clarionhub.com/t/setting-up-multi-file-selections-using-the-dosfilelookup-template/7759 "2024-12-19T14:24:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Klondike](https://clarionhub.com/user_avatar/clarionhub.com/klondike/32/6655_2.png) [@Klondike](https://clarionhub.com/u/Klondike)\
**Post date:** [December 19, 2024, 2:24pm UTC](https://clarionhub.com/t/setting-up-multi-file-selections-using-the-dosfilelookup-template/7759/1 "2024-12-19T14:24:44Z")

</div>

I want to use the DOSFileLookup template to select multiple files from File Explorer, then copy them to a Clarion table. When I check the Multi-Select box, I have an entry field to fill in. What do I place here? What else must be done in various embed points to do this? ChatGPT, while very sure of itself, was not that helpful, and mostly a timewaster.

 ![DOSFileLookup](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/5/5e23f8664db0e7e163e52bc7aa1d35c4529d5f4a.png)

---

<div class="post-metadata">

**Author:** ![Gustavo\_Saracca](https://clarionhub.com/user_avatar/clarionhub.com/gustavo_saracca/32/5355_2.png) [@Gustavo\_Saracca](https://clarionhub.com/u/Gustavo_Saracca)\
**Post date:** [December 19, 2024, 4:23pm UTC](https://clarionhub.com/t/setting-up-multi-file-selections-using-the-dosfilelookup-template/7759/2 "2024-12-19T16:23:48Z")

</div>

Something like the following:

add\_files(),

_Where:_

```auto
! add_files()

add_files procedure()
    CODE
    CLEAR( QF )
    QF:file_names = loc:file_name
    GET( QF, QF:file_names )
    IF ERRORCODE() THEN
        CLEAR( QF )
        QF:file_names = loc:file_name
        ADD( QF )
    END !* if *
    DISPLAY()

!* end *

```

---

<div class="post-metadata">

**Author:** ![Rick\_UpperPark](https://clarionhub.com/user_avatar/clarionhub.com/rick_upperpark/32/346_2.png) [@Rick\_UpperPark](https://clarionhub.com/u/Rick_UpperPark)\
**Post date:** [December 19, 2024, 5:07pm UTC](https://clarionhub.com/t/setting-up-multi-file-selections-using-the-dosfilelookup-template/7759/3 "2024-12-19T17:07:50Z")

</div>

I personally don’t use the template for multi-file select. Here’s an example of declaring a select file class and using it in code.

```clarion
TheTypes cstring('Images(*.jpg;*.png;*.gif;*.bmp;*.pcx;*.tga;*.tif;*.j2k;*.jp2;*.ps)|*.jpg;*.png;*.gif;*.bmp;*.pcx;*.tga;*.tif;*.j2k;*.jp2;*.ps|Word (.docx;.doc)|*.docx;*.doc|Excel (.xlsx;.xls)|*.xlsx;*.xls|Adobe (.pdf)|*.pdf|All|*.*') !
NewAttachment cstring(FILE:MaxFilePath) !
ReturnValue Long
GetFilesClass Class(SelectFileClass)
  End
AttachmentFileQ SelectFileQueue
PathSize LONG
lCnt LONG

  CODE
  NewAttachment = clip(iniMgr.TryFetch('SavedValues', 'IPM_ProjectAttachmentPath'))
  if not NewAttachment or not exists(NewAttachment)
    NewAttachment = ds_GetFolderPath(WE::CSIDL_PERSONAL)
  end
  GetFilesClass.Init()
  GetFilesClass.WindowTitle = 'Select document or image to attach'
  GetFilesClass.DefaultFile = NewAttachment
  GetFilesClass.SetMask(TheTypes)
  GetFilesClass.Flags = FILE:KeepDir+FILE:LongName+File:Multi
  GetFilesClass.Ask(AttachmentFileQ,false)
  If Records(AttachmentFileQ)
    Loop lCnt = 1 To Records(AttachmentFileQ)
      Get(AttachmentFileQ,lCnt)
      NewAttachment = AttachmentFileQ.Name

```

---

<div class="post-metadata">

**Author:** ![Klondike](https://clarionhub.com/user_avatar/clarionhub.com/klondike/32/6655_2.png) [@Klondike](https://clarionhub.com/u/Klondike)\
**Post date:** [December 20, 2024, 3:26pm UTC](https://clarionhub.com/t/setting-up-multi-file-selections-using-the-dosfilelookup-template/7759/4 "2024-12-20T15:26:28Z")

</div>

Thanks for the example code. It’s given me a good start.
