note 61251 deleted from function.imagecopyresampled by cmb

From: Date: Sun, 19 May 2019 16:04:13 +0000
Subject: note 61251 deleted from function.imagecopyresampled by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-211070@lists.php.net to get a copy of this message
Note Submitter: areddan at silverarm dot ie ---- $file =$_FILES[userfile]; //name of the input form file upload element is userfile //$to_file is a full path including filename //to where you want the thumnail to be copied to . //example /usr/www/users/www/images/thumbs/thumb1.jpg copy($file[tmp_name],$to_file) or die("The file $file[tmp_name] you are trying to upload couldn't be copied to $to_file"); //Extra stuff to put into the output to allow for jpeg / png or gif //replace line: imagegif($thumb2, $fileout); //write to file with the following switch($format) { case 'image/jpeg': imagejpeg($thumb2, $fileout,90); //write to file break; case 'image/gif'; imagegif($thumb2, $fileout); //write to file break; case 'image/png': imagepng($thumb2, $fileout); //write to file break; }

« previous php.notes (#211070) next »