here is what I have for the function moveUploadedImage
Code:function moveUploadedImage( $_FILES, $fname, $path_and_name, $maxsize='', $imResize='true' ) { global $pic_height; global $pic_width; $height = $pic_height; if ( !$height ) $height = 250; $width = $pic_width; if ( !$width ) $width = 250; if ( $maxsize && ($_FILES[$fname]['size'] > $maxsize || $_FILES[$fname]['size'] == 0) ) { if ( file_exists($_FILES[$fname]['tmp_name']) ) { unlink($_FILES[$fname]['tmp_name']); } return false; } else { $scan = getimagesize($_FILES[$fname]['tmp_name']); if ( ($scan['mime'] == 'image/jpeg' && $ext = '.jpg' ) || ( $scan['mime'] == 'image/gif' && $ext = '.gif' ) || ( $scan['mime'] == 'image/png' && $ext = '.png' ) || ( $scan['mime'] == 'image/bmp' && $ext = '.bmp' ) ) { $path_and_name .= $ext; move_uploaded_file( $_FILES[$fname][tmp_name], $path_and_name ); if ( $imResize ) imageResize( $path_and_name, $path_and_name, $width, $height ); } else { return IMAGE_ERROR_WRONG_TYPE; } } return $ext; }


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks