public function fileProxy() { file_put_out($this->path); }
public function image() { if (filesize($this->path) <= 1024 * 10) { //小于10k 不再生成缩略图 file_put_out($this->path); } load_class('imageThumb'); $image = $this->path; $image_thum = DATA_THUMB . md5($image) . '.png'; if (!is_dir(DATA_THUMB)) { mkdir(DATA_THUMB, "0777"); } if (!file_exists($image_thum)) { //如果拼装成的url不存在则没有生成过 if ($_SESSION['this_path'] == DATA_THUMB) { //当前目录则不生成缩略图 $image_thum = $this->path; } else { $cm = new CreatMiniature(); $cm->SetVar($image, 'file'); //$cm->Prorate($image_thum,72,64);//生成等比例缩略图 $cm->BackFill($image_thum, 72, 64, true); //等比例缩略图,空白处填填充透明色 } } if (!file_exists($image_thum) || filesize($image_thum) < 100) { //缩略图生成失败则用默认图标 $image_thum = STATIC_PATH . 'images/image.png'; } file_put_out($image_thum); }
public function public_link() { load_class('mcrypt'); $pass = $this->config['setting_system']['system_password']; $path = Mcrypt::decode($this->in['fid'], $pass); //一天内解密有效 if (strlen($path) == 0) { show_json($this->L['error'], false); } if (!file_exists($path)) { show_tips($this->L['not_exists']); } file_put_out($path); }
print $dest; if (!move_uploaded_file($upfile['tmp_name'], $dest)) { print "<p> error to upload is your file to big?"; } } $op = $_GET['op']; if ($op === 'exit') { session_destroy(); unset($_SESSION['user']); ob_clean(); echo "<a href=?op=login>Logout Ok!Click here to login in!</a>"; } else { if ($op === 'down') { echo "start download"; $dfilename = $_GET['dname']; file_put_out($dfilename, true); } else { $folder_name = $_GET['folder_name']; if ($folder_name == "") { $file_list = path_list("./"); } else { $file_list = path_list(sprintf("%s", $folder_name)); } $folders = $file_list['folderlist']; print sprintf("<p> <a href=%s?folder_name=%s>%s</a>", $_SERVER['PHP_SELF'], $folder_name . "/.", "."); print sprintf("<p> <a href=%s?folder_name=%s>%s</a>", $_SERVER['PHP_SELF'], $folder_name . "/..", ".."); for ($i = 0; $i < count($folders); $i++) { $links = sprintf("<p> <a href=%s?folder_name=%s%s>%s</a>", $_SERVER['PHP_SELF'], $folders[$i]['path'], $folders[$i]['name'], $folders[$i]['name']); print $links; } echo "</p>";
public function image() { if (filesize($this->path) <= 1024 * 10) { //Less than 10k longer to generate thumbnails file_put_out($this->path); } load_class('imageThumb'); $image = $this->path; $image_thum = DATA_THUMB . md5($image) . '.png'; if (!is_dir(DATA_THUMB)) { mkdir(DATA_THUMB, "0777"); } if (!file_exists($image_thum)) { //If assembled into the url does not exist, it does not generate too if ($_SESSION['this_path'] == DATA_THUMB) { //Thumbnails will not be generated in the current directory $image_thum = $this->path; } else { $cm = new CreatMiniature(); $cm->SetVar($image, 'file'); //$cm->Prorate($image_thum,72,64);//Thumbnail generation ratio $cm->BackFill($image_thum, 72, 64, true); //Proportional thumbnails, fill the space filled with a transparent color } } if (!file_exists($image_thum) || filesize($image_thum) < 100) { //Thumbnail generation fails with the default icon $image_thum = STATIC_PATH . 'images/image.png'; } file_put_out($image_thum); }