php - Uploading images from FLASH in CakePHP -


i'm having trouble handling images created flash application, sends data via raw post data, , it's writing image /webroot folder.

here's php code have in "avatarcontroller.php" file.

public function uploadimage() {     $this->autorender = false; // no view file      if ($this->request->is('post')) // if post data     {         $auser = $this->acurrentuser(); // gets user info          if ( isset ( $globals["http_raw_post_data"] )) // gets raw post data         {             $simgname = $auser['user']['username'] . '_full' . '.png';              $fp = fopen($simgname, "wb");             fwrite( $fp, $globals[ 'http_raw_post_data' ] );             fclose( $fp );         }      } } 

what i'm having trouble saving different folder e.g. /webroot/avatars, , how go resizing image, want have 3 or sizes, example "username_full", "username_80", "username_50"; full size, 80% smaller, 50% smaller, etc.

i've never handled uploads this, flash.

any help, suggestions?

http://www.kavoir.com/2009/01/php-resize-image-and-store-to-file.html

this looks decent tutorial on resize/move business php. other part regard grabbing file itself, see post, http://www.kirupa.com/forum/showthread.php?360502-as3-php-file-upload you're doing may work tend use $_files variable it's clear me what's going in there.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -