All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
asp.net缩略图和水印制作-Image,Generation_[Asp.Net教程]
初学,ASP.NET,AJAX,(四):Timer,和,UpdateProgress_[Asp.Net教程]
Ajax标签导航实例详解-大结局_[AJAX教程]
ASP.NET技巧:Session丢失原因与解决方案小结_.net资料_编程技术
用PHP读取和编写XML,DOM_php资料_编程技术
在ASP.NET,2.0中数据绑定的实现方法_.net资料_编程技术
动态网页PHP中引用&的使用注意事项_php资料_编程技术
asp.net2.0网站语法之HTML服务器控件语法
使用ASP.NET内置类生成图片缩略图及水印_[Asp.Net教程]
PHP+MySQL动态网站开发基础实例教程_[PHP教程]
Reading number is top 10 pictures
青春清纯美女大集合4
Average female college students3
中国女孩大胆自拍,显露完美身材2
More attractive than sora aoi1
深圳的风光
Azusa Yamamoto1
The little woman's bright wire2
Beautiful Japanese beauty(漂亮的日本美女)2
The real super beauty6
Hunan province aizhai super-large suspension bridge open to traffic and 4 world first1
Download software ranking
Proficient in Eclipse
VC++6.0培训教程
仙剑奇侠传98硬盘WINXP版
Love the forty days
Unix video tutorial17
Adobe Flash Player(IE) 10.0.32.18 浏览器专用的FLASH插件
Unix video tutorial10
Boxer's Top ten classic battle1
传奇私服架设教程
apache-tomcat-6.0.33
delv published in(发表于) 2013/12/29 4:40:57 Edit(编辑)
php上传获取文件相应参数-获取上传文件后缀名_php资料_编程技术

php上传获取文件相应参数-获取上传文件后缀名_php资料_编程技术

php上传获取文件相应参数-获取上传文件后缀名_php资料_编程技术-你的首页-uuhomepage.com
以下是我上传了一个图片后显示的 $_FILES['filename']的信息
[filename] => Array
(
[name] => Winter.jpg
[type] => image/jpeg
[tmp_name] => /tmp/php2jw7QX
[error] => 0
[size] => 105542
)
其中type是文件类型的minitype 表示方法,例如普通的HTML的类型是text/html
如果你想用扩展名的方式判断的话可以用以下代码:
#允许的文件扩展名
$allowed_types = array('jpg', 'gif', 'png');
$filename = $_FILES['filename']['name'];
#正则表达式匹配出上传文件的扩展名
preg_match('|\.(\w+)$|', $filename, $ext);
#print_r($ext);
#转化成小写
$ext = strtolower($ext[1]);
#判断是否在被允许的扩展名里
if(!in_array($ext, $allowed_types)){
die('不被允许的文件类型');
}
?>



添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.