vich上传程序图像将作为临时文件移至xampp

时间:2018-11-15 18:04:47

标签: symfony image-uploading vichuploaderbundle

您好,我正在通过vich上传功能上传图像,并且将路径名返回为。

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

  

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 :(得分:0)

尝试将\中的uri_prefix: '\uploads\images\manchetes'中的/更改为 ticket_id = 1234 message = f'{ticket_id} Jira created successfully' ,然后重试。

答案 1 :(得分:0)

首先,正如Ez所述,您需要在uri_prefix中更改\。
其次,这是您的 easy_admin配置中使用编辑表单的问题。
您需要在表单,新建或编辑配置下使用from google.cloud import storage storage_client = storage.Client() def hello_gcs_generic(data, context): bucket = storage_client.get_bucket(data['bucket']) blob = bucket.blob(data['name']) contents = blob.download_as_string() # Process the file contents, etc... 属性,而不要使用caminhoDaImagem,并且文件类型应从文件更改为vich_file或vixh_image。 ..文档https://symfony.com/doc/master/bundles/EasyAdminBundle/integration/vichuploaderbundle.html#uploading-the-images-in-the-edit-and-new-views

中已经提到
arquivoDaImagem

我修复了您的代码,您可以看到我的 PR

相关问题