Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function upload() {
- require_once '../class/Upload.class.php';
- $this->slide_foto = "";
- $dir_dest = '../fotos/slide/';
- $file = $_FILES['slide_foto'];
- $handle = new Upload($file);
- if ($handle->uploaded) {
- $handle->file_overwrite = true;
- //$handle->image_convert = 'png';
- //Configuracoes de redimensionamento paisagem
- $plMax = 1300; //largura maxima permitida
- $paMax = 450; // altura maxima permitida
- if ($handle->image_src_x > $plMax || $handle->image_src_y > $paMax) {
- //$handle->image_ratio_x = true;
- $handle->image_resize = true;
- $handle->image_x = 1000;
- $handle->image_y = 380;
- }
- $handle->file_new_name_body = md5(uniqid($file['name']));
- $handle->Process($dir_dest);
- if ($handle->processed) {
- $this->slide_foto = $handle->file_dst_name;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement