|
发表于 2011-6-3 19:28:05
|
显示全部楼层
- <?php
- echo 'SAE图床程序 by:MJJ 滴 <a href="http://www.4kwu.com" target="_blank">Lov-Lov</a><br/>
- <form action="" method="post" enctype="multipart/form-data">
- 选择文件:<input type=file name=upfile>[不要超过10MB!!]<br/>
- <input type=submit value="upload">
- </form><br/><br/>
- ';
- require_once('saes3.ex.class.php');
- $s = new SaeS3();
- $act=$_GET['act'];
- if(isset($_FILES['upfile']['name'])){
- $fname=$_FILES['upfile']['name'];
- $ftype=explode(".",strtolower($fname));
- $fn=time().md5(rand(21,999));
- $url = $s->write( 'imagex',$fn.".".$ftype[1] ,file_get_contents($_FILES['upfile']['tmp_name']) );
- echo "<a href="".$url.""">$url</a>";
- if($ftype[1]=="jpg"||$ftype[1]=="gif"||$ftype[1]=="jpeg"||$ftype[1]=="png"||$ftype[1]=="bmp"||$ftype[1]=="psd"){
- ;echo ' <br/><br/>图片外链演示:<br/><img src="';echo $url;echo '">
- ';
- }
- }
- ?>
复制代码 |
|