zoukankan      html  css  js  c++  java
  • file size php

    <!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;
    }
    ?>
    
  • 相关阅读:
    Oracle
    注解
    java 算法实现
    ConcurrentHashMap
    hashMap 1.8
    hashmap 1.7
    MySQL优化
    Mysql面试题
    tmux
    mysql 复制表结构、表数据的方法
  • 原文地址:https://www.cnblogs.com/sky20080101/p/6797668.html
Copyright © 2011-2022 走看看