CamelCamelCamel
CamelCamelCamel

Reputation: 5200

implementing uploadify in kohana 3

I have a hard time implementing uploadify inside kohana 3, what changes should I make to the originial uploadify.php? just making it the index function in a controller doesn't work and returns a 500 error.

Thank you!

Upvotes: 0

Views: 796

Answers (2)

roomcays
roomcays

Reputation: 947

I'm not too sure if this will help, but I spent many hours dealing with uploadify the other day, and one of the tricks was to give back ANY response from the upload controller to let uploadify know that uploading is done. Solution as simply as this:

$this->request->response = "OK";

However, 500 states for interval server error, so the case might be also passing session ID with the 'scriptData' parameter when initializing uploadify, like this:

$('#file_upload').uploadify({'scriptData': {'<?php echo $session_name; ?>': '<?php echo session_id(); ?>'}});

Hope this helps, cheers!

Upvotes: 1

Stefan H Singer
Stefan H Singer

Reputation: 5504

Are you using Uploadify 2.1.x or 3.0 beta?

Anyway, you should be able to use any controller you want as long as you set the parameters in the javascript accordingly. And make sure you're not using a template for the controller dealing with the file uploads.

For instance, if you have a controller "files" and an action "uploadify" at URI /site/files/uploadify you should set the parameter to something like this:

'script'    : '/site/files/uploadify',

Upvotes: 0

Related Questions