
is_uploaded_file() 函数检查文件是否是通过 HTTP POST 上传的。如果文件是通过 HTTP POST 上传的,则该函数返回 TRUE。失败时返回 FALSE。
语法
is_uploaded_file(file_path)
参数
file_path -指定要检查的文件。
返回
如果文件是通过 HTTP POST 上传的,is_uploaded_file() 函数将返回 TRUE。失败时返回 FALSE。
假设我们正在上传包含以下内容的文件“new.txt”。
2088shop商城购物系统是商城系统中功能最全的一个版本:非会员购物、商品无限级分类、不限商品数量、商品多级会员定价、上货库存、Word在线编辑器、订单详情销售报表、商品评论、留言簿、管理员多级别、VIP积分、会员注册积分奖励、智能新闻发布、滚动公告、投票调查、背景图片颜色更换、店标上传、版权联系方式修改、背景音乐(好歌不断)、广告图片支持Flash、弹出浮动广告、搜索引擎关健词优化、图文友情联
立即学习“PHP免费学习笔记(深入)”;
This is demo text!
示例
"; // displaying contents of the uploaded file echo "Reading Contents of the file:
"; readfile($_FILES['userfile'][‘new.txt']); } else { echo "File ". $_FILES['userfile'][‘new.txt'] ." failed in uploading! File upload attack could be the reason!
"; } ?>
输出
File new.txt uploaded successfully! Reading Contents of the file: This is demo text!
Let us see another example with file “details.txt”.
示例
Live Demo
输出
Not uploaded via HTTP POST!










