hi 2345,...
I download it. I have a question,...
where do you put your "action"...??? (this is from previous one)
<form id="form5" action="<?php echo $html->url('/groups/upload/' .
$group['Group']['id'], true) ?>" method="post" enctype="multipart/form-
data">

...coz I have to have upload to go to group_controller function
upload($id = null), ...coz it must create photos in different sizes.


  function upload($id = null)
  {

      $this->authorize();
     $user = $this->User->findById($this->user['id']);

    if(!($group = $this->Group->findById($id)))
    {
      $this->flash('error', ucfirst(i18n::translate('group not
found')));
      $this->redirect('/');
    }

    else
     {
       $this->set('group', $group);

      $secret = $this->generateRandomString(20);
      $name = str_replace(array('.jpg', '.jpeg', '.JPG', '.JPEG',
'.png', '.PNG'), '', $this->params['form']['Filename']);

      if($this->GroupPhoto->save(array('GroupPhoto' => array('name' =>
$name, 'user_id' => $this->user['id'], 'group_id' => $group['Group']
['id'], 'secret' => $secret, 'hidden' => 0))))
      {
        $this->Group->query('UPDATE fociki_groups' . ' SET photos =
photos + 1' . ' WHERE id = ' . $group['Group']['id']);

        $original_file = $this->GroupPhoto->getOriginalFile($this-
>GroupPhoto->id, $secret, true);
        $original_file_path = $original_file->pwd();
        move_uploaded_file($this->params['form']['Filedata']
['tmp_name'], $original_file_path);

        exec('/usr/bin/convert -geometry 400x360 ' .
$original_file_path . ' ' . $this->GroupPhoto->getMediumFile($this-
>GroupPhoto->id, $secret)->pwd() .' > /dev/null 2>&1 &');
        exec('/usr/bin/convert -geometry 135x135 ' .
$original_file_path . ' ' . $this->GroupPhoto->getSmallFile($this-
>GroupPhoto->id, $secret)->pwd() .' > /dev/null 2>&1 &');
        exec('/usr/bin/convert -geometry 140x220 ' .
$original_file_path . ' ' . $this->GroupPhoto->getThumbFile($this-
>GroupPhoto->id, $secret)->pwd() .' > /dev/null 2>&1 &');
        exec('/usr/bin/convert -thumbnail x150 -resize "150x<" -resize
50% -gravity center -crop 75x75+0+0 +repage ' . $original_file_path .
' ' . $this->GroupPhoto->getSquareFile($this->GroupPhoto->id, $secret)-
>pwd() .' > /dev/null 2>&1 &');
      }

      echo 'OK';
      die();
    }

  }

Thanks
chris


On Feb 8, 7:44 pm, thatsgreat2345 <thatsgreat2...@gmail.com> wrote:
> I use uploadify, works just fine with cakephp, allows multiple file
> uploads and restriction to file types before uploading.
>
> On Feb 8, 7:01 pm, "chris...@yahoo.com" <chris...@yahoo.com> wrote:
>
>
>
>
>
>
>
> > Hi guys,
>
> > need help with UPLOAD...
> > I have SWF Uploader originaly setup on a script for photos.
> > And its uploading greate on photos,... however I have created groups
> > and group photos seperated from original one.
> > Now with this when I'm trying to upload I'm loosing session_id() when
> > I try to set it up to::: post_params: {"PHPSESSID": "<?php echo
> > session_id(); ?>"},
>
> > HERE IS THE ORIGINAL for PHOTOS
>
> >     var swfu;
>
> >     window.onload = function() {
> >       var settings = {
> >         flash_url : "<?php echo $this->webroot ?>swf/swfupload.swf",
> >         upload_url: "<?php echo $html->url('/photos/upload?
> > PHPSESSID=' . session_id(), true) ?>",  // Relative to the SWF file
> >         post_params: {},
>
> > HERE IS THE ONE for GROUP PHOTOS when its lossing session_id()
>
> >     var swfu;
>
> >     window.onload = function() {
> >       var settings = {
> >         flash_url : "<?php echo $this->webroot ?>swf/swfupload.swf",
> >         upload_url: "<?php echo $html->url('/groups/upload/' .
> > $group['Group']['id'], true) ?>",       // Relative to the SWF file
> >         post_params: {"PHPSESSID": "<?php echo session_id(); ?>"},
>
> > AND HERE IS THE ONE for GROUP PHOTOS when I'm having with group ID ...
> > $group['Group']['id'] in there,... BUT THIS ONE GIVES ME AN ERROR. I
> > CAN'T FIGURE OUT WHAT'S WRONG IN IT...
>
> > CAN ANYONE HELP... ???
>
> >     var swfu;
>
> >     window.onload = function() {
> >       var settings = {
> >         flash_url : "<?php echo $this->webroot ?>swf/swfupload.swf",
> >         upload_url: "<?php echo $html->url('/groups/upload/ .
> > $group['Group']['id']?PHPSESSID=' . session_id(), true) ?>",    //
> > Relative to the SWF file
> >         post_params: {"PHPSESSID": "<?php echo session_id(); ?>"},
>
> > or can anyone suggest good uploader,... so it can upload
> > all: .jpg, .bmp, .gif, .pdf. ect... this SWF uploader is good, it can
> > upload multiple files. any ohter good once out there...???
>
> > THANK YOUUUUU ALLLLL !!!
> > chris

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to