'latest', 'region' => S3_REGION, 'credentials' => [ 'key' => S3_KEY, 'secret' => S3_SEC, ], ]); if ($type == 2) { if ($fileExt == 'jpg') exifRotate($_FILES['upfiles']['tmp_name'][$i]); //가로세로 교정 ResizeWidth($_FILES['upfiles']['tmp_name'][$i],$_FILES['upfiles']['tmp_name'][$i],$d['mediaset']['thumbsize']); @chmod($_FILES['upfiles']['tmp_name'][$i],0707); $IM = getimagesize($_FILES['upfiles']['tmp_name'][$i]); $width = $IM[0]; $height= $IM[1]; } try { $s3->putObject(Array( 'ACL'=>'public-read', 'SourceFile'=>$_FILES['upfiles']['tmp_name'][$i], 'Bucket'=>S3_BUCKET, 'Key'=>$folder.'/'.$tmpname, 'ContentType'=>$_FILES['upfiles']['type'][$i] )); unlink($_FILES['upfiles']['tmp_name'][$i]); // getLink('','',$_FILES['upfiles']['tmp_name'][$i].' 여기까지',''); } catch (Aws\S3\Exception\S3Exception $e) { $result['error'] = 'AwS S3에 파일을 업로드하는 중 오류가 발생했습니다.'; } } else { $host = ''; $folder = str_replace('.','',$saveDir).$folder; $src = $folder.'/'.$tmpname; for ($j = 1; $j < 4; $j++) { if (!is_dir(${'savePath'.$j})) { mkdir(${'savePath'.$j},0707); @chmod(${'savePath'.$j},0707); } } $saveFile = $savePath3.'/'.$tmpname; if ($Overwrite == 'true' || !is_file($saveFile)) { move_uploaded_file($_FILES['upfiles']['tmp_name'][$i], $saveFile); if ($type == 2) { if ($fileExt == 'jpg') exifRotate($_FILES['upfiles']['tmp_name']); //가로세로 교정 ResizeWidth($_FILES['upfiles']['tmp_name'],$_FILES['upfiles']['tmp_name'],$d['mediaset']['thumbsize']); @chmod($_FILES['upfiles']['tmp_name'],0707); $IM = getimagesize($saveFile); $width = $IM[0]; $height= $IM[1]; } @chmod($saveFile,0707); } } $mingid = getDbCnt($table['s_upload'],'min(gid)',''); $gid = $mingid ? $mingid - 1 : 100000000; $QKEY = "gid,pid,category,hidden,tmpcode,site,mbruid,fileonly,type,ext,fserver,host,folder,name,tmpname,size,width,height,alt,caption,description,src,linkto,license,down,d_regis,d_update,sync,linkurl"; $QVAL = "'$gid','$gid','$category','$hidden','$tmpcode','$s','$mbruid','$_fileonly','$type','$fileExt','$fserver','$host','$folder','$name','$tmpname','$size','$width','$height','$alt','$caption','$description','$src','$linkto','$license','$down','$d_regis','$d_update','$sync','$linkurl'"; getDbInsert($table['s_upload'],$QKEY,$QVAL); getDbUpdate($table['s_numinfo'],'upload=upload+1',"date='".$date['today']."' and site=".$s); if ($gid == 100000000) db_query("OPTIMIZE TABLE ".$table['s_upload'],$DB_CONNECT); $_nowPer = (int)((($i+1)/$upfileNum)*100); ?>