首页 文章

vich uploader图像作为临时文件转到xampp

提问于
浏览
0

您好我正在使用vich upload上传图片,并将路径名称返回为 .

图像正在上传并显示在简易管理员中 . 但后来它突然开始不再加载图像,我发现目标目录已更改为 - >

C:\ xampp_ \ tmp \ phpB51C.tmp

我的vich映射就像

mappings:
    manchete_images:
        uri_prefix:  '\uploads\images\manchetes' 
        upload_destination:  '%kernel.project_dir%/public/uploads/images/manchetes'

图像正常显示,然后突然开始破坏并且不在公共目录中创建文件上载文件

2 回答

  • 0

    尝试更改 uri_prefix: '\uploads\images\manchetes'\/ ,然后重试 .

  • 0

    Ez提到您需要更改\ uri_prefix中的\ .
    其次,使用编辑表单在 easy_admin configuration 中存在问题 .
    你需要在你的表单,新的或编辑配置下使用 caminhoDaImagem proprety而不是 arquivoDaImagem ,并且文件类型应该从file更改为vich_file或vixh_image . ..已经在doc https://symfony.com/doc/master/bundles/EasyAdminBundle/integration/vichuploaderbundle.html#uploading-the-images-in-the-edit-and-new-views中提到了

    easy_admin:
        entities:
            Product:
                # ...
                form:
                    fields:
                        - { property: 'imageFile', type: 'vich_image' }
    

    我修改了你的代码,你可以看到我的PR

相关问题