function _MoveHttpFile($file, $guid) { if (!@$file["tmp_name"]) { throw new Exception("(1) tmp_name is not available for " . PhpUploader_GetFileName($file)); } if (!PhpUploader_FileExists($file["tmp_name"])) { throw new Exception("(1) tmp_name is not exists " . $file["tmp_name"]); } PhpUploader_Log("_MoveHttpFile {$file} : {$guid}"); $this->SecurityCheckFileName(PhpUploader_GetFileName($file)); $extension = strtolower(pathinfo(PhpUploader_GetFileName($file), PATHINFO_EXTENSION)); if ($extension == "php") { PhpUploader_Log("try_upload_php_file"); throw new Exception("(1) fails to upload file : " . PhpUploader_GetFileName($file)); } $dir = $this->InternalGetTempDirectory(); $filepath = "{$dir}/uploading." . $guid . "." . PhpUploader_GetBaseName(PhpUploader_GetFileName($file)) . ".resx"; PhpUploader_Log(" to : {$filepath}"); //throw(new Exception("Get file ".PhpUploader_GetFileName($file)." - $filepath")); $result = PhpUploader_MoveUploadedFile(__FILE__, __LINE__, $file["tmp_name"], $filepath); if (!$result) { throw new Exception("Unable save file to {$filepath}"); } }
function _MoveHttpFile($file, $guid) { if (!@$file["tmp_name"]) { throw new Exception("(1) tmp_name is not available for " . PhpUploader_GetFileName($file)); } if (!PhpUploader_FileExists($file["tmp_name"])) { throw new Exception("(1) tmp_name is not exists " . $file["tmp_name"]); } PhpUploader_Log("_MoveHttpFile {$file} : {$guid}"); $this->SecurityCheckFileName(PhpUploader_GetFileName($file)); $extension = strtolower(pathinfo(PhpUploader_GetFileName($file), PATHINFO_EXTENSION)); if ($extension == "php") { PhpUploader_Log("try_upload_php_file"); throw new Exception("(1) fails to upload file : " . PhpUploader_GetFileName($file)); } $dir = $this->InternalGetTempDirectory(); $filepath = "{$dir}/uploading." . $guid . "." . PhpUploader_GetBaseName(PhpUploader_GetFileName($file)) . ".resx"; PhpUploader_Log(" to : {$filepath}"); $result = PhpUploader_MoveUploadedFile(__FILE__, __LINE__, $file["tmp_name"], $filepath); /* if($result){ $nomeArquivo = $file['name']; $caminho = $this->SaveDirectory; $endereco = $caminho."/".$nomeArquivo; $arrCaminho = explode("/", $endereco); echo $caminho; $path = $caminho; $diretorio = dir($path); echo "Lista de Arquivos do diretório '<strong>".$path."</strong>':<br />"; while($arquivo = $diretorio -> read()){ echo "<a href='".$path.$arquivo."'>".$arquivo."</a><br />"; } $diretorio -> close(); // fez o upload agora redimensiona a imagem require_once "../canvas/canvas.php"; include("../../inc/config.inc.php"); ini_set('display_errors', 1); error_reporting(E_ALL); * $img = new canvas; $img->load($endereco); $img->resize("5%"); $img->save(); var_dump($img); echo $endereco; } */ if (!$result) { throw new Exception("Unable save file to {$filepath}"); } }