Answer the question
In order to leave comments, you need to log in
VichUploaderBundle not saving file?
# src/AppBundle/Entity/Video
/**
* @Vich\UploadableField(mapping="user_videos", fileNameProperty="original")
* @var \Symfony\Component\HttpFoundation\File\UploadedFile
*/
private $originalFile;
# app/config/config.yml
....
oneup_flysystem:
adapters:
my_adapter:
local:
directory: %kernel.root_dir%/../web/uploads
filesystems:
my_fs:
adapter: my_adapter
vich_uploader:
db_driver: orm
storage: flysystem
mappings:
user_videos:
# uri_prefix: /user_videos
upload_destination: my_fs
inject_on_load: true
delete_on_update: true
delete_on_remove: true
An exception occurred while executing 'INSERT INTO videos (updated_at, created_at, original, user_id) VALUES (?, ?, ?, ?)' with params [\"2015-08-17 00:48:55\", \"2015-08-17 00:48:55\", null, null]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1048 Column 'original' cannot be null
Answer the question
In order to leave comments, you need to log in
The problem was that vichuploader cached the metadata (@Vich\Uploadable).
ps strange that it caches metadata even in dev environment
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question