Good morning,

On 2/07/10 at 10:30 AM +0200, Bernhard Bauch <ba...@zsi.at> wrote:

i'm trying to use this super nice jquery file uploader with progress bar (http://www.uploadify.com/).

[...]

the problem is i did not manage to restore the session from the session-id 
manually.
i did try to call some of the functions of Plugin::Session manually, but it did 
not work out.

Use Session::State::URI, eg.

  use Catalyst qw/ ....
    Session
    Session::Store::FastMmap
    Session::State::Cookie
    Session::State::URI


And in your javascript, tell uploadify which session_id to use:

    $('#uploadify').uploadify({
        ....
        'scriptData'  : {'session.id': '[% c.sessionid %]' },
        ...

Note, I generate the javascript in my template file, so the session_id becomes hard-coded in each page. You could also read the current cookie session and pass that in instead.

Also, I did that code ages ago, there could be some other config data elsewhere that I'm not remembering. Eg. I'm not sure why the scriptData is using session.id rather than session_id.

I also seem to recall having to put in an exception somewhere for my upload action, again don't recall what that way. If you get stuck let me know and I'll dig through my code some more.

Charlie

--
   Ꮚ Charlie Garrison ♊ <garri...@zeta.org.au>

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to