如何在 Silverstripe 用户表单模块中添加上传文件字段

How to add an upload FileField in the Silverstripe User Forms module

我有一个 Silverstripe 网站,管理员可以在其中使用 userform module 创建在线表单。

在我为用户窗体工作的旧网站上有一个用于 'File Upload Field' 的窗体选项。

在我当前的网站上,我下载了最新版本的用户表单模块,但文件上传选项未在表单选项中列出。有谁知道我遗漏了什么/我需要做什么才能让管理员能够将文件上传器添加到页面?

这是可用选项的图片, Silverstripe form dropdown

看起来 EditableFileField 目前需要 Secure Assets Module 才能工作。如果未安装安全资产模块,则不会出现 File Upload Field

对于 Silverstripe Userforms 模块 4.5 和 Silverstripe 3.6,如果你真的不想像我一样安装安全资产模块来启用文件上传字段,你可以在 mysite/_config 中创建一个 secureassets.yml 文件=]文件夹并添加一些yml配置如下:

---
Name: userformsnosecurityoverride
After:
  - '#userformsnosecurity'
Except:
  ModuleExists: secureassets
---
EditableFileField:
  hidden: false

这将覆盖默认设置并使文件上传字段可见。