开发者

implementing uploadify in kohana 3

开发者 https://www.devze.com 2023-02-04 06:16 出处:网络
I have a hard time implementing uploadify inside开发者_StackOverflow中文版 kohana 3, what changes should I make to the originial uploadify.php? just making it the index function in a controller doesn\

I have a hard time implementing uploadify inside开发者_StackOverflow中文版 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!


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!


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',
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号