> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# openfilesdialog

> Mo Windows file-open dialog thong qua Windows file picker voi multi-select duoc bat va tra ve cac tep da chon duoi dang gia tri file item.

<div className="real-function-page">
  ```lua theme={null}
  openfilesdialog(options?: DialogOptions): { FileSystemItem } | nil
  ```

  ## Đối số

  <ParamField path={"options"} type={"DialogOptions"}>
    Optional table. Voi openfilesdialog, title, defaultPath va extensionFilter duoc su dung. extensionFilter la table gom extension strings; dau . hoac \*. o dau se bi loai bo truoc khi moi filter thanh \*.\<extension>.
  </ParamField>

  ## Giá trị trả về

  <ResponseField name={"files"} type={"{ FileSystemItem } | nil"}>
    Array table gom cac gia tri file item cho cac tep da chon, hoac nil khi dialog bi huy hoac khong co selected filesystem paths duoc tra ve. Dialog failures se throw Failed to open file dialog.
  </ResponseField>

  ## Kiểu

  ### DialogOptions

  Định cấu hình hộp thoại chọn tệp hoặc thư mục gốc.

  | Name               | Type                 | Required | Mô tả                                                                                              |
  | ------------------ | -------------------- | -------- | -------------------------------------------------------------------------------------------------- |
  | `title`            | `string`             | No       | Đặt tiêu đề cửa sổ hộp thoại.                                                                      |
  | `defaultPath`      | `string`             | No       | Chọn thư mục hiển thị khi hộp thoại mở ra.                                                         |
  | `extensionFilter`  | `&#123;string&#125;` | No       | Giới hạn các tệp có thể chọn ở các tiện ích mở rộng được liệt kê, có hoặc không có dấu chấm ở đầu. |
  | `suggestedName`    | `string`             | No       | Cung cấp tên tệp ban đầu trong hộp thoại lưu.                                                      |
  | `defaultExtension` | `string`             | No       | Đặt phần mở rộng được sử dụng khi tên tệp đã nhập không có.                                        |

  ## Ví dụ

  Mo file picker de chon mot hoac nhieu tep va xu ly tung selected file item.

  ```lua theme={null}
  local files = openfilesdialog({
      title = "Choose source files",
      defaultPath = ".",
      extensionFilter = { "lua", "luau", "txt" },
  })

  if files then
      for _, file in ipairs(files) do
          print(file:GetName())
          print(file:IsFile())
      end
  else
      print("No files selected")
  end
  ```
</div>
