-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
onUpload UploadListener notwork!! #40
Comments
Hi Stefano I guess this is the EventListener you are talking about. Am I right? Why do you call a $file = $event->getFile(); Could you verify if the constructor of the Listener gets called? |
thank you for your quickly answer. is one of chance that i choose trying to understand the problem. I use this for my template from blueimp page it is as if the listener is not called. |
There are several possibilities why the Listener does not get called.
But you should probably first check this one: In the docs the name of the <tag name="kernel.event_listener" event="oneup_uploader.post_persist" method="onUpload" /> Try change the tag-name to |
i am sorry. When i changed container to kernel is started to work well. Now i see the response. stefano |
Hello ! |
@aymerixp Please specify your problem. I'm happy to help. If you think it could be a problem with the bundle itself, ask here or in a new ticket. If you think it's more question-like, consider posting your problem to Stackoverflow, so others can profit from it too. (Remember tagging your question with |
I asking here because my fronted return me "Error Empty file upload result". |
There was already an issue and a Stackoverflow thread regarding return values for jQuery File Uploader. Furthermore, take a look at the official documentation and the Return custom data to the Frontend section of this bundle. You should end up with something like this. namespace Acme\HelloBundle\EventListener;
use Oneup\UploaderBundle\Event\PostPersistEvent;
class UploadListener
{
public function onUpload(PostPersistEvent $event)
{
$file = $event->getFile();
$response = $event->getResponse();
$response['files'] = array(
array(
'name' => $file->getFilename(),
'url' => //...
'thumbnail_url' => //...
// more keys ..
)
);
}
} There reason why this bundle does not return anything by default is the fact, that you could implement a custom JavaScript function to handle return values. You're not bound to this scheme. |
That exactly what I was looking for ! Thank you a lot ! It works great ! |
hi, i've problem when i try to use listener. Maybe is my fault. I'm in symfony 2.3 with postgresSQL. I try to use that with sonata media.
my service
"die()" not work.
Can you explain me why?
thanks in advance
regards
Stefano
The text was updated successfully, but these errors were encountered: