On 12 February 2011 13:22, parallel32 <[email protected]> wrote:
> Chris,
>
> I had a similar problem with my swfuploader component which was losing
> the session on IE only. Turns out it was a simple change in the
> cakephp core configuration that fixed it.
>
> Change Configure::write('Session.checkAgent', true); in core.php to
> false.
Or you can pass the session id to the upload url, and in that
controller's beforeFilter create the session, eg (for use with
Uploadify):
// documents controller
public function beforeFilter() {
if ($this->action == 'admin_upload') {
if (isset($this->params['pass'][0])) {
$this->Session->id($this->params['pass'][0]);
$this->Session->start();
}
}
parent::beforeFilter();
}
// in your view
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$("#DocumentFiledata").uploadify({
'uploader' : '/swf/uploadify.swf',
'script' : '/admin/documents/upload/<?php echo
$this->Session->id(); ?>',
'cancelImg' : '/img/admin/uploadify/cancel.png',
'queueID' : 'fileQueue',
'auto' : 'false',
'multi' : true,
'simUploadLimit' : 1,
'queueSizeLimit' : 100,
'fileDataName' : 'data[Document][filedata]'
});
});
</script>
The nice thing about this is you have one upload method which responds
to either a normal http post from the user submitting the form or via
Uploadify.
hth
Jon
--
jon bennett - www.jben.net - blog.jben.net
--
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
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php