首页 > Web开发 > 详细

file size php

时间:2017-05-02 19:10:24      阅读:201      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> New Document </title>
  <meta charset="GBK">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>

 <body>
<form method="get" action="fileSize.php">
	<input type="text" name="file">
	<br>
	<input type="submit" value="submit">
</form>
 </body>
</html>

 

 <?php
 function GetFileSize($file)
{
	if (file_exists($file))
	{
		return filesize($file);
	}
	else
	{
      return -1;
	}
}

if(isset($_GET["file"]))
{
	header("Content-type: text/plain; charset=gbk"); 
	$file=$_GET["file"];

	$a = GetFileSize($file);
	print_r($a);
	return;
}
else
{
	echo -1;
}
?>

 

file size php

原文:http://www.cnblogs.com/sky20080101/p/6797668.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!