getFileType(basename($_GET['path'])); if ($fileTypes['preview']) { switch($fileTypes['fileType']) { case "image": $imageInfo = @getimagesize($_GET['path']); if (!empty($imageInfo[0]) && !empty($imageInfo[1])) { $thumInfo = getThumbWidthHeight($imageInfo[0], $imageInfo[1], 400, 135); printf("", getFileUrl($_GET['path']), $thumInfo['width'], $thumInfo['height']); }else { echo PREVIEW_IMAGE_LOAD_FAILED; } break; case "txt": if (($fp = @fopen($_GET['path'], 'r'))) { echo @fread($fp, @filesize($_GET['path'])); @fclose($fp); }else { echo PREVIEW_OPEN_FAILED . "."; } break; case "video": break; } }else { echo PREVIEW_NOT_PREVIEW . ".."; } }else { echo PREVIEW_NOT_PREVIEW . "..."; } ?>