SHARE
TWEET

Untitled

a guest Jun 17th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (!empty($_FILES['avariaFoto']['name'])) {
  2.   $files = array();
  3.   foreach($_FILES['avariaFoto'] as $k => $l) {
  4.     foreach($l as $i => $v) {
  5.       if (!array_key_exists($i, $files)) $files[$i] = array();
  6.       $files[$i][$k] = $v;
  7.     }
  8.   }
  9.   foreach($files as $file) {
  10.     $handle = new upload($file);
  11.     if ($handle - > uploaded) {
  12.       $handle - > file_new_name_body = date('dmYhis');
  13.       $handle - > image_resize = true;
  14.       $handle - > image_x = 800;
  15.       $handle - > image_ratio_y = true;
  16.       $handle - > jpeg_quality = 75;
  17.       $handle - > image_convert = 'jpg';
  18.       $handle - > file_overwrite = false;
  19.       $handle - > file_auto_rename = true;
  20.       $handle - > mime_check = true;
  21.       $handle - > Process('imagens/');
  22.       $foto = $handle - > file_dst_name;
  23.  
  24.       if ($handle - > processed) {
  25.         $handle - > clean();
  26.       } else {
  27.         echo '  Erro: '.$handle - > error.
  28.         '';
  29.       }
  30.     }
  31.   }
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top