错误如下:
文件" C:\ xampp \ tmp \ php5B9.tmp"不存在 500内部服务器错误 - 在vendor \ symfony \ symfony \ src \ Symfony \ Component \ HttpFoundation \ File \ File.php中的堆栈跟踪的FileNotFoundException 第37行
我使用Symfony 2.8,VichUploader 1.3.1和YML实体配置
我的formType:
$builder ->add('name') ->add('frontImage', VichImageType::class, array( 'required' => false, ));
My config file:
<pre>
vich_uploader:
db_driver: orm
mappings:
category_image:
uri_prefix: /images/categories
upload_destination: %kernel.root_dir%/../web/images/categories
namer: vich_uploader.namer_uniqid
我的实体:
AppBundle\Entity\Category: type: entity table: category repositoryClass: AppBundle\Repository\CategoryRepository gedmo: soft_deleteable: field_name: deletedAt time_aware: false tree: type: nested id: id: type: integer nullable: false unsigned: true id: true generator: strategy: IDENTITY fields: name: type: string nullable: true length: 100 fixed: false column: name type: type: ModelObjectType length: 20 nullable: false visible: type: boolean nullable: true deletedAt: type: datetime nullable: true frontImageName: type: string length: 255 nullable: true deviceAlertThreshold: type: integer nullable: true unsigned: true lft: type: integer nullable: true gedmo: - treeLeft rgt: type: integer nullable: true gedmo: - treeRight lvl: type: integer nullable: true gedmo: - treeLevel oneToMany: categoryParameter: targetEntity: CategoryParameter mappedBy: category cascade: [all] orphanRemoval: true children: targetEntity: Category mappedBy: parent cascade: [remove] orderBy: lft: ASC devices: targetEntity: Device mappedBy: category manyToOne: root: targetEntity: Category joinColumn: referencedColumnName: id onDelete: CASCADE gedmo: - treeRoot parent: targetEntity: Category inversedBy: children joinColumn: referencedColumnName: id onDelete: CASCADE gedmo: - treeParent lifecycleCallbacks: { }
在资源/ config / vich_uploader中配置:
AppBundle\Entity\Category: frontImage: mapping: category_image filename_property: frontImageName
请帮忙!
答案 0 :(得分:0)
问题已解决。问题出在基本控制器上,我使用了这样的东西:Request :: createFromGlobals(),一切似乎都运行良好