vichuploaderbundle

Serialization of UploadedFile is not allowed

我的未来我决定 提交于 2021-02-04 16:42:05
问题 I'm trying to upload a file via vichuploader bundle on my Users entity. Using hwioauthbundle that implements UserInterface, and i think the errors comes from that bundle... So every time i try to uplod a file i got this exception : Serialization of 'Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed I already tried this solution but also same exception. namespace AppBundle\Entity; use Doctrine\ORM\Mapping as ORM; use HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface;

VichUploaderBundle - namer: Parent definition does not exist

不羁的心 提交于 2021-01-27 04:42:18
问题 config.yml vich_uploader: db_driver: orm mappings: media_image: uri_prefix: '%uploads_dir%' upload_destination: '%kernel.root_dir%/../web/uploads/images' namer: Vich\UploaderBundle\Naming\OrignameNamer Entity: /** * Media * @Vich\Uploadable * @ORM\Table(name="medias") * @ORM\Entity(repositoryClass="AppBundle\Repository\MediaRepository") */ class Media { use TimestampableEntity; /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */

How to use Vich uploader with easyAdmin 3 on Symfony 5

守給你的承諾、 提交于 2021-01-21 08:36:52
问题 I've been trying to use VichUploader to upload files on a Symfony project, already using EasyAdmin 3. I've configured everything correctly, but I'm getting this error: The "pieceJointeFile" image field must define the directory where the images are uploaded using the setUploadDir() method. <?php namespace App\Entity; use App\Repository\InventaireRepository; use DateTime; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\HttpFoundation\File\File; use Vich\UploaderBundle\Mapping\Annotation

How to use Vich uploader with easyAdmin 3 on Symfony 5

孤人 提交于 2021-01-21 08:35:32
问题 I've been trying to use VichUploader to upload files on a Symfony project, already using EasyAdmin 3. I've configured everything correctly, but I'm getting this error: The "pieceJointeFile" image field must define the directory where the images are uploaded using the setUploadDir() method. <?php namespace App\Entity; use App\Repository\InventaireRepository; use DateTime; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\HttpFoundation\File\File; use Vich\UploaderBundle\Mapping\Annotation

How to use Vich uploader with easyAdmin 3 on Symfony 5

﹥>﹥吖頭↗ 提交于 2021-01-21 08:34:29
问题 I've been trying to use VichUploader to upload files on a Symfony project, already using EasyAdmin 3. I've configured everything correctly, but I'm getting this error: The "pieceJointeFile" image field must define the directory where the images are uploaded using the setUploadDir() method. <?php namespace App\Entity; use App\Repository\InventaireRepository; use DateTime; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\HttpFoundation\File\File; use Vich\UploaderBundle\Mapping\Annotation

VichUploaderBundle - PropertyAccessor requires a graph of objects or arrays to operate on, but it found type “NULL”

流过昼夜 提交于 2021-01-05 07:49:05
问题 i try to make this bundle running with Form. First this is my entity <?php namespace App\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\HttpFoundation\File\UploadedFile; use Vich\UploaderBundle\Entity\File as EmbeddedFile; use Vich\UploaderBundle\Mapping\Annotation as Vich; /** * @ORM\Entity(repositoryClass="App\Repository\BanqueRepository") * @Vich\Uploadable */ class Banque { /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM

How to use mimeType Assert with VichUploader?

☆樱花仙子☆ 提交于 2020-02-03 05:15:27
问题 This assert is passing Symfony's form validation when uploading any file with VichUploaderBundle: /** * @Vich\UploadableField(mapping="product_media", fileNameProperty="path") * @Assert\File( * mimeTypes = {"image/jpeg", "image/gif", "image/png", "video/mp4", "video/quicktime", "video/avi"}, * mimeTypesMessage = "Wrong file type (jpg,gif,png,mp4,mov,avi)" * ) * @var File $pathFile */ protected $pathFile; I cannot see what the problem is with the assert. How can I validate file types with

liip_imagine with vich_uploader not creating cache

僤鯓⒐⒋嵵緔 提交于 2020-02-02 06:37:13
问题 I am working on a Symfony project which consists of two inner projects. ONE project and MARKETPLACE project. Here is how the files strucure in the web. web/ ---one/ #this one is being called from subdomain one.domain.com ------/app_dev.php ---marketplace/ #this one is being called from the main domain domain.com ------/app_dev.php now i have a third folder ---/images i want to allow the user to upload images from the ONE and to be displayed in the MARKETPLACE here is my config apps/config

Upload an image to amazon S3 using VichUploaderBundle

ⅰ亾dé卋堺 提交于 2019-12-23 04:04:29
问题 I am using VichUploaderBundle to upload images to AmazonS3 in symfony-2. I have followed this documentation https://github.com/dustin10/VichUploaderBundle/blob/master/Resources/doc/index.md and created my entity class. So I have a setter method in the entity /** * @param UploadedFile $file */ public function setFile(File $file = null) { $this->file = $file; $this->updated = new \DateTime(); } The client (This is a web application) will be sending the image in base_64 format. So I dont