Questions tagged [vichuploaderbundle]

A simple Symfony2 bundle to ease file uploads with ORM entities, MongoDB ODM documents, PHPCR ODM documents or Propel models.

The VichUploaderBundle is a bundle that attempts to ease file uploads that are attached to ORM entities, MongoDB ODM documents, PHPCR ODM documents or Propel models.

  • Automatically name and save a file to a configured directory
  • Inject the file back into the entity or document when it is loaded from the datastore as an instance of Symfony\Component\HttpFoundation\File\File
  • Delete the file from the file system upon removal of the entity or document from the datastore
  • Templating helpers to generate public URLs to the file

All of this functionality is fully configurable to allow for app-specific customization

If your question matches problems described in the bulletlist below then use this tag.

Project page

253 questions
1
vote
0 answers

Symfony 6 VichUploader - can't update/delete file

i simply try to update/delete a file in sonata admin with VichUploader bundle. But in both cases i have this error : Expected argument of type "string", "null" given at property path "filename". note : on delete, the entity is delete anyway and the…
mysterty
  • 31
  • 7
1
vote
0 answers

vich_uploader default picture when no uploaded file

I'm using Vich uploader. Everything is fine, I can see the pic I have uploaded. But when there's none, there is a blank, which is kind of ugly. So I decided to upload an icon instead. I'm trying to do something like: if you don't upload a picture,…
1
vote
1 answer

vichuploader image not uploaded + image name is null

I want to use vichuploader to manage image upload on my Symfony 5.4 project. I got the image_name cannot be null SQL error but can't find why... The mapping naming is good the updateAt field is filled. I don't see anything. Thanks for your…
RomHill
  • 113
  • 3
  • 10
1
vote
0 answers

SOLVED Symfony 6 / PropertyAccessor requires a graph of objects or arrays to operate on, but found type "NULL" while trying to traverse path

I require some help, I'm facing this problem since one month and try to solve it (already searched on many forums but nothing worked). Here is my error screen PropertyAccessor requires a graph of objects or arrays to operate on, but it found type…
Hiika
  • 11
  • 3
1
vote
0 answers

Variable "pageName" does not exist Symfony 5 EasyAdmin 4

I'm trying to render an image from VichUploader Bundle, and I succeed to do it. But when I try to include : '@EasyAdmin/crud/detail.html.twig' in my twig file I got an pageName does not exist. And when I do not set a custom template on my…
Arciesis
  • 21
  • 4
1
vote
0 answers

Symfony VichUploader can't display an image of an entity

i'm new in symfony and i try to display an image in a view with Vich Uploader but don't know how to. I have an entity Brand with a logo related (OneToMany) to an entity Ship. When i try to display the logo of the brand in the view (show.html.twig)…
Kamo
  • 11
  • 1
1
vote
0 answers

Change Vich uploader S3 mapping on the fly

For a project with Symfony/API Platform I'm working on I need to set up 1 Amazon S3 bucket per region, so 1 bucket for EU, 1 for US, ... When a user posts a file, the api first has to determine the region of the user, then decide which bucket to…
1
vote
1 answer

Displaying an image uploaded outside of the public directory in a Symfony API

I am working with Symfony as an API and a React frontend divided in two separate projects. I store user uploaded images inside a medias/ folder at the root of the Symfony project because some images are confidential (this is a business app) so they…
yurden
  • 152
  • 1
  • 16
1
vote
1 answer

How to upload multiple files with vich uploader in Symfony 5

Expected argument of type "AppBundle\Entity\File", "AppBundle\Entity" given while trying to upload multiple files using vichuploader in formtype of collectionType
L3xpert
  • 1,109
  • 1
  • 10
  • 19
1
vote
0 answers

EasyAdmin error :"Vich\UploaderBundle\Form\Type\VichImageType" ,The options "upload_dir", "upload_filename" do not exist

I apologize, my English is very bad. I need your help. I develop an application with symfony 5. I use EasyAdmin 3 And VichUploader to load image. this is my vich_uploader.yaml : vich_uploader: db_driver: orm mappings: site: …
1
vote
0 answers

Serialization of 'Symfony\Component\HttpFoundation\File\File' is not allowed

I'm making a Symfony project where user can upload a profile picture. I use VichUploaderBundle to manage image uploads. I've made it in my entity like this : /** * @ORM\Entity(repositoryClass=UserRepository::class) * @Vich\Uploadable */ class…
Newbiedev
  • 141
  • 3
  • 20
1
vote
1 answer

Serving static files with API platform

I am creating an API with API platform. One of the features is to be able to upload and download files from a React client developped independently from my API 1 - First try I followed the docs to setup VichUploaderBundle which led me to the exact…
jeannot789
  • 33
  • 1
  • 6
1
vote
1 answer

Could not determine access type for property "image" in class "App\Entity\XXXX". Symfony 4 - EasyAdmin 3.2 - VichUploader

Strugling here trygin to integrate VichImageUploader into my EasyAdmin 3.2. This version of EasyAdmin is letting us create custom Fields which works just fine. In my case I am only trying to upload 1 image and push it into my DB. I set up my Easy…
1
vote
1 answer

Vichupload no mapping....?

I am trying to use the vichuploaderbundle. By following exactly the following procedure I encounter an error: https://github.com/dustin10/VichUploaderBundle/blob/master/docs/usage.md The error is An exception occurred while executing 'INSERT INTO…
jerome linher
  • 71
  • 1
  • 2
1
vote
2 answers

Upload Image on EasyAdmin V3

I can't upload an image from EasyAdmin V3, I also added VichUpload. I must write setUploadDir() otherwise I have this error message: and if I put this method I have this message: in the meantime I am commenting on lines 161 to 163…
Aurel_64
  • 11
  • 1
  • 2