On Jan 14, 8:47 am, booboobenny <[EMAIL PROTECTED]> wrote:
> I am hoping someone here can help me out with this one.
>
> I am using swfupload and cake, I implemented using the articles on the
> bakery as a starting point.
>
> I have a controller /foo and in that controller I have a method
> upload. So the upload url is:
>
> /foo/upload
>
> When the form submits I get a 302 error. Does anyone know a way to
> submit the form (i would prefer to avoid ajax) to /foo/upload and not
> get a 302 error.

I think the SwfUpload is meant specifically for use with AJAX. The
problem with AJAX and file uploads is that you normally need to submit
the form in order to send file data to the server. Since the page
reloads with a form submit the only previous solution was to submit
the form to a hidden iframe and parse the server response when the
iframe loads. Flash is actually a great interface for uploading files
since it doesn't require a form submit and can even provide feedback
in so far as upload progress, etc.. I don't think using SwfUpload
without AJAX would provide any benefits over using a conventional form
file input - if it even is possible.

Anyway, I implemented a similar thing using Mootools and
Swiff.Uploader and I can tell you that using the controller->log
function is invaluable for debugging. My implementation is a little
different than the one on the bakery, but if it helps, my controller
looks like:

http://pastebin.com/f457cfcf

And the component looks like:

http://pastebin.com/f2a167234

You might notice my implementation is for single files only - however
I have tested it on a number of server setups - with PHP in safemode,
root-jailing, etc.. - and it has worked for me so it might be useful
for you? Good luck!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to