使用symfony上的FMElfinder浏览器上传文件类型

时间:2015-04-08 12:15:41

标签: symfony elfinder

我已成功将FMElfinderBundle与IvoryCkeditor集成。感谢提供商。

现在,我正在寻找上传<input type="file">的文件 从同一个elfinder浏览器到symfony as,

$builder->add('file', 'file');

对于这种情况,是否可以从Elfinder文件浏览器上传文件?

更新

我对elfinder的配置看起来像这样,

fm_elfinder:
    instances:
        default:
            locale: %locale% # defaults to current request locale
            editor: ckeditor # other options are tinymce, tinymce4, form, custom and simple
            fullscreen: true # defaults true, applies to simple and ckeditor editors
            theme: smoothness # jquery theme
            include_assets: true # disable if you want to handle loading of the javascript and css assets yourself
            connector:
                debug: false # defaults to false
                roots:       # at least one root must be defined
                    uploads:
                        show_hidden: false # defaults to false
                        driver: LocalFileSystem
                        path: uploads
                        upload_allow: ['image/png', 'image/jpg', 'image/jpeg']
                        upload_deny: ['all']
                        upload_max_size: 2M
        form:
            locale: %locale% # defaults to current request locale
            editor: form # other choices are tinymce or simple, and form
            fullscreen: true # defaults true, applies to simple and ckeditor editors
            include_assets: true # disable if you want to handle loading of the javascript and css assets yourself
            connector:
                debug: false # defaults to false
                roots:       # at least one root must be defined
                    uploads:
                        driver: LocalFileSystem
                        path: uploads
                        upload_allow: ['image/png', 'image/jpg', 'image/jpeg']
                        upload_deny: ['all']
                        upload_max_size: 2M

和我的表单类型为elfinder表单类型,

->add('image','elfinder', array('instance'=>'form', 'enable'=>true))

我的输出结果只是一个文字字段,没有点击弹出窗口,问题是什么?

1 个答案:

答案 0 :(得分:2)

Bundle为这种情况提供了自己的表单类型。 Elfinder form type,btw使用输入文件类型,在我看来假设您将通过自己的控制器处理文件上传过程

相关问题