RequestHandler to work with an AJAX call to your controller's action.
http://book.cakephp.org/view/174/Request-Handling
The only "gotcha" is if you need to debug what's happening on the
server-side, and try to mimic the AJAX call manually, you'd have to
make sure that it runs the AJAX-based code regardless of the request
type (i.e.: isAjax() actually tests the headers to make sure it's an
AJAX call and not a standard HTML "GET" or "POST", if it's not, it
won't render).
I understood that you got it to work with the supplied upload.php file
from the Uploadify package. You actually got further than I did in
that case...it refused to store my test files to the server. It
LOOKED like it was all working, but the files just were nowhere to be
found (in my entire server's webroot, not just the specific
virtualhost's webroot).
Also, don't forget...if you just want something to work out of the
box, you might just be able to find other solutions......such as:
http://t.wits.sg/2008/06/25/howto-php-and-jquery-upload-progress-bar/
Not quite as nice as Uploadify though.
On Apr 3, 5:00 pm, Robert McWay <mcway_web_des...@cox.net> wrote:
> Sorry, let me clarify...i was using the upload.php script that was
> included with Uploadify... Could you please give me a little more info
> about how i would use RequestHandler to map an AJAX call to my action?
> Thanks again for the help.
>
> On Apr 3, 11:34 am, Brendon Kozlowski <Brendon...@hotmail.com> wrote:
>
> > If you're sending it to a separate upload file that was not created
> > specifically for its use, I believe you're technically modifying its
> > originally intended and expected behavior. I would instead use the
> > supplied upload.php file and use the JavaScript's onComplete or
> > onAllComplete callback method (depending on how you're using it) to do
> > any further data-related things (like renaming the file), which you
> > could use in conjunction with CakePHP's RequestHandler to map AJAX
> > calls to the appropriate action.
>
> > ...or you could try and figure out how all 3 files interact with the
> > file system and modify it to your needs. It seems both options would
> > require some work.
>
> > On Apr 3, 1:42 pm, Robert McWay <mcway_web_des...@cox.net> wrote:
>
> > > It works if i try and call an unrelated upload.php in the document
> > > root, but i still cannot get it to call the "upload" action of the
> > > "photos" controller...
>
> > > On Apr 3, 7:21 am, Brendon Kozlowski <Brendon...@hotmail.com> wrote:
>
> > > > From reading over that topic - on quick glance after using the script
> > > > a bit - it looks like this is a case of something trying to be
> > > > helpful, and doing too much. Think Microsoft Office Word and it's
> > > > ability to auto-set your margins for you to be "helpful".
>
> > > > Without taking a deeper look at both the uploader.fla, upload.php and
> > > > jquery.uploadify (Source).js files (and perhaps a quick visit to
> > > > CakePHP's mod_rewrite section of the .htaccess file), I won't have an
> > > > answer for you...and considering I already have a long list of other
> > > > things to work on, I don't think I'll be able to get to this anytime
> > > > soon. One question I do have for you though (as it makes a small
> > > > difference), is the upload being done for you on a *.ctp file from a
> > > > controller's view, a pagecontroller's view, or from an unrelated file
> > > > in the document root?
>
> > > > On Apr 2, 6:22 pm, Robert McWay <mcway_web_des...@cox.net> wrote:
>
> > > > > That was one of the first things i tried...When i changed this it
> > > > > created a "files" folder in the root cake direcory...thats why i had
> > > > > to change it to its current path. The answer has something to do with
> > > > > the way cakephp writes the urls..I found a post topic in the Uploadify
> > > > > forum, (http://www.uploadify.com/forum/viewtopic.php?f=7&t=47&p=210&hilit=mvc...
> > > > > ), where someone had a similar issue with code ignitor, but i could
> > > > > not get the proposed answer to work. Thanks for the help...
>
> > > > > On Apr 2, 3:00 pm, Brendon Kozlowski <Brendon...@hotmail.com> wrote:
>
> > > > > > Without taking any further look at how this script and included jQuery
> > > > > > function actually works (but the settings you provided)...try changing
> > > > > > the "folder" setting's value to simply "/files".
>
> > > > > > If that doesn't work I might actually take a look at this. It's
> > > > > > probably very simple to fix, and the script itself sounds neat (and
> > > > > > possibly useful). :)
>
> > > > > > On Apr 2, 3:53 pm, Robert <mcway_web_des...@cox.net> wrote:
>
> > > > > > > I am trying to implement the JQuery Plugin, "Uploadify" in my CakePHP
> > > > > > > project...but I am having a problem calling the upload script
> > > > > > > specified in the "script" parameter...This is due to the fact that the
> > > > > > > CakePHP "Pretty URLs" are breaking it. After some research through
> > > > > > > this forum, i came across a post where someone was having a similar
> > > > > > > problem in CodeIgniter...The solution was to strip the pagepath
> > > > > > > variable from the uploadify script, to allow use of pretty
> > > > > > > urls...however i still cannot get the script to find my upload
> > > > > > > script...
>
> > > > > > > my jquery function...
>
> > > > > > > $('#PhotoFilename').fileUpload({
> > > > > > > 'uploader': '/uploader.swf',
> > > > > > > 'script': '/photos/upload',
> > > > > > > 'folder': '/app/webroot/files',
> > > > > > > 'cancelImg': '/img/cancel.png',
> > > > > > > 'multi': true
> > > > > > > });
>
> > > > > > > ..from jquery.uploadify: setting the pagepath to nothing...
>
> > > > > > > var f="&pagepath=";
>
> > > > > > > I have tried using a relative path, as well as an absolute path, for
> > > > > > > teh "script" parameter, but nothing has worked...Any insight would be
> > > > > > > much appreciated...- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment