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;
}
?>
时间: 2024-08-05 21:31:48

file size php的相关文章

Intellij IDEA中file size exceeds configured limit解决

把Hadoop源码导入IDEA中后,其中有个ClientNamenodeProtocolProtos文件代码高达82997行,IDEA直接就不把它当java类看了,报file size exceeds configured limit错误. 解决办法如下: 你可以尝试修改intellij IDE安装目录下的bin/idea.properties, 将其中的idea.max.intellisense.filesize=2500改成大一些,比如idea.max.intellisense.filesi

Reducing File Size

[Reducing File Size] 1.Unity strips out unused assets. The amount of assets in your project folder does not influence the size of your built player. Unity is very smart about detecting which assets are used in your game and which are not. Unity follo

How to calculate a good InnoDB log file size

Peter wrote a post a while ago about choosing a good InnoDB log file size.  Not to pick on Peter, but the post actually kind of talks about a lot of things and then doesn’t tell you how to choose a good log file size!  So I thought I’d clarify it a

[Intellij IDEA]File size exceeds configured limit

这两天尝试使用 IDEA, 发现一个问题File size exceeds configured limit (2560000). Code insight features not available. 原因: IDEA对能关联的文件大小做了限制,主要是为了保护内存,默认值为2500kb,对于一般的java文件也够用了,只是这里我用protocbuf生成的java文件过大,达到3M多. 其设置在...JetBrains\IntelliJ IDEA Community Edition 14.1.

解决访问 jar 包里面的字体报错:OTS parsing error: incorrect file size in WOFF header

前言:jar 包里面的字体加载,浏览器 console 中报警告信息,这里记录一下解决方案. 附:自己的一个 jar 包源码 https://github.com/yuleGH/querydb 错误问题: 谷歌浏览器 console 中报警告信息: Failed to decode downloaded font: http://localhost:8080/font/element-icons.woff?v=230-rc1 OTS parsing error: incorrect file s

C++ get file size

1/#include <fstream> std::ifstream::pos_type filesize(const char* filename) { std::ifstream in(filename, std::ifstream::ate | std::ifstream::binary); return in.tellg(); } 2/ #include <fstream> int getFileSize(const std::string &fileName) {

Github 修正上传时“this exceeds GitHub’s file size limit of 100 MB”错误

Github只允许上传最大100MB的文件,如果超过,则会被server reject 则需: git filter-branch --force --index-filter "git rm --cached --ignore-unmatch Project1/Project1.1\ Sample\ Project/output.txt"  --prune-empty --tag-name-filter cat -- --all git commit --amend -CHEAD g

Java determine uncompressed size of gzipped file

If you want to determine the uncompressed size of a gzip file from within a program, you can extract to original file size from the gzip file. This size is stored in the last 4 bytes of the file. This will only provide the correct value if the compre

php 下 html5 XHR2 + FormData + File API 上传文件

FormData的作用: FormData对象可以帮助我们自动的打包表单数据,通过XMLHttpRequest的send()方法来提交表单.当然FormData也可以动态的append数据.FormData的最大优点就是我们可以异步上传一个二进制文件. 例1如下: <!DOCTYPE HTML> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <title>