Comments (13)
Hello @simbu-g2t sorry for the delay.
What are you trying to upload?
And at this line it tries to get the Provider did you registered it?
from sonata-multiupload-bundle.
@simbu-g2t So what kind of provider are you trying to use?
- You want to use the image provider?
- Can you provide me your
sonata_media.yaml
?
from sonata-multiupload-bundle.
It's working if I add the provider(sonata.media.provider.image) at line number 51 in
/vendor/silasjoisten/sonata-multiupload-bundle/src/Controller/MultiUploadController.php
like$providerName = $request->query->get('provider','sonata.media.provider.image');
In your snippet you are setting a default for provider
. if there is no query parameter it will use the default. This behaviour is not so graceful. The logic requires a registered provider otherwise the app has no idea how to handle file/image/video etc.
Are you using default "select provider" view from Sonata or are you trying to generate a direkt url to image multi upload?
from sonata-multiupload-bundle.
@simbu-g2t Okay so you are generating a direct multi upload link to the multi upload action. You need to pass the provider query parameter.
And for the selection of an provider go to the media grid/list view and it should be done automatically when you click on new
1.
2. This is the page to select Provider (to get the route you can use bin/console debug:router
command) and create an link to that
3.
from sonata-multiupload-bundle.
Maybe see that: #56 (comment) There is an example for an custom Audio Provider and how to register that
from sonata-multiupload-bundle.
Thanks for your help @silasjoisten
from sonata-multiupload-bundle.
How to register the provider? Can you guide me or give the code?
FYI: I'm new to sonata and symfony
It's working if I add the provider(sonata.media.provider.image) at line number 51 in /vendor/silasjoisten/sonata-multiupload-bundle/src/Controller/MultiUploadController.php
like $providerName = $request->query->get('provider','sonata.media.provider.image');
from sonata-multiupload-bundle.
Currently I'm using direct URL for multiple upload. It is better if we can able to select provider. I don't know how to do that. This is my sonata_media.yaml
# config/packages/sonata_media.yaml
sonata_media:
# if you don't use default namespace configuration
class:
media: App\Application\Sonata\MediaBundle\Entity\Media
gallery: App\Application\Sonata\MediaBundle\Entity\Gallery
gallery_has_media: App\Application\Sonata\MediaBundle\Entity\GalleryHasMedia
db_driver: doctrine_orm # or doctrine_mongodb, doctrine_phpcr it is mandatory to choose one here
default_context: default # you need to set a context
contexts:
default: # the default context is mandatory
providers:
- sonata.media.provider.dailymotion
- sonata.media.provider.youtube
- sonata.media.provider.image
- sonata.media.provider.file
- sonata.media.provider.vimeo
formats:
admin: { width: 100 , height: 100 , quality: 80}
small: { width: 200 , quality: 80}
medium: { width: 3000 , quality: 80}
big: { width: 500 , quality: 70}
blog: # the default context is mandatory
providers:
- sonata.media.provider.image
- sonata.media.provider.file
formats:
admin: { width: 100 , height: 100 , quality: 80}
small: { width: 200 , quality: 80}
medium: { width: 3000 , quality: 80}
big: { width: 500 , quality: 70}
cdn:
server:
path: /uploads/media # http://media.sonata-project.org/
filesystem:
local:
directory: '%kernel.root_dir%/../public/uploads/media'
create: false
from sonata-multiupload-bundle.
But I don't see the provider in that page, Anything need to add in config to see that?
from sonata-multiupload-bundle.
From the step 3, I followed this only
parameters:
sonata.media.admin.media.controller: SilasJoisten\Sonata\MultiUploadBundle\Controller\MultiUploadController
Anything need to do after this?
from sonata-multiupload-bundle.
Do you have a custom provider?
from sonata-multiupload-bundle.
Please read the manual carefully again please you need to do some other things too. You need to override the provider and use a trait.
from sonata-multiupload-bundle.
No, I don't have custom provider right now. Currently I resolved with the below code(added provider in query param) in my sonata_admin.yaml. It's working now with direct URL and I removed the provider query from /vendor/silasjoisten/sonata-multiupload-bundle/src/Controller/MultiUploadController.php
# config/packages/sonata_media.yaml
sonata_admin:
title: 'Sonata Admin'
title_logo: images/logo.png
dashboard:
groups:
media:
label: Media
label_catalogue: ~
icon: '<i class="fa fa-image"></i>'
items:
- route: admin_sonata_media_gallery_list
label: Gallery
- route: admin_sonata_media_media_list
label: Media
- route: admin_sonata_media_media_multi_upload
label: Add Multiple Images
route_params:
provider: sonata.media.provider.image
It should be better if I select the provider from media, But I don't know to create a custom provider
from sonata-multiupload-bundle.
Related Issues (20)
- 4.0.0 version ability to remove provider on runtime over Provider Chain
- Testing `4.0.1-rc` version of this bundle HOT 2
- Rework docs
- Replacing jQuery with VueJS
- Refactoring Translation files
- Return to the media list onComplete HOT 2
- Can't get this bundle to work HOT 1
- Could not upload file in Gallery (Sonata Media Bundle) HOT 6
- Video upload no image shown
- ManagerInterface HOT 1
- Drop PHP 7.0 Support
- Fix TreeBuilder deprecations
- Does not work on Symfony 4 HOT 30
- Cannot autowire service HOT 2
- Can't get it to work SF4 HOT 1
- Is there any way to define the min/max width-height and orientation requirements? HOT 5
- Update with recent sonata version, drop requirement of "sonata-project/core-bundle" HOT 2
- Add from model type not working anymore HOT 1
- Update Sonata Version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonata-multiupload-bundle.