Thursday, March 31, 2011

Re: multiple file upload in php

On Thu, Mar 31, 2011 at 3:34 PM, Rishab Jain <jairishab@gmail.com> wrote:
> Hi,
>
> This works fine when I created a non-cakephp based setup. However, when I
> try to use it in a cake based setup, it gives me an error. After almost an
> hour of debugging, I saw that the problem lies in,
>
>         $('#file_upload').uploadify({
>           'uploader'  : 'path_to_uploadifyswf/uploadify.swf',
>           'script'    : 'http://dev.mydomain.com/multiupload/',
>           'cancelImg' : 'pathtoimages/cancel.png',
>           'folder'    : 'uploaded_files',
>           'multi'       : true,
>
> Here, when I give the script URL to be of an action of a controller, it
> gives me a 302 Error. However, when I change it to
>           'script'    :
> 'http://dev.mydomain.com/non_cake_based_setup/multiupload.php',
>
> It works then.
>
> Really have no idea about this behaviour. Anybody having any idea here?

Do you have a route for '/multiupload/'? That needs to point to a
controller somehow.

Mine is:
Router::connect(
'/upload',
array('controller' => 'files', 'action' => 'upload')
);

BTW, I'm using Nick Baker's FileUpload plugin and jQuery.MultiFile.
http://www.webtechnick.com/blogs/view/221/CakePHP_File_Upload_Plugin
http://code.google.com/p/jquery-multifile-plugin/

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: