php的函数好像对中文支持有问题?~!
解决方案 »
- php+mysql 关于update数据组的问题
- 多重三元运算的问题:$v = 5; $t = ( $v < 10 ) ? "A" : ( $v > 5 ) ? "B" : "C"; print $t; 这个结果怎么会是B,应该是A啊。
- 可以通过程序将文件转化编码吗?
- PHP中向数据库储存中文的问题
- php如何做日志记录?
- 头大了,很郁闷啊!!!!!!!!!!!!!!!!!!!!!!
- 简单的session问题
- header函式怎样将数组参数传送到下一页?
- 为啥这里的$_GET[ ]数组是它的一个方法呢
- 网站QQ登陆突然出现redirect uri is illegal(100010) 异常问题
- 是什么问题啊。我的头大了不少(总是解决不了)
- mysql数据导出问题
我使用中文的变量名,就没有问题~
我使用中文的变量名,就没有问题~
move_uploaded_file
試一試
我没有用过move_uploaded_file
谢谢
// In PHP 4.1.0 or later, $_FILES should be used instead of $HTTP_POST_FILES.
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
copy($HTTP_POST_FILES['userfile']['tmp_name'], "/place/to/put/uploaded/file");
} else {
echo "Possible file upload attack. Filename: " . $HTTP_POST_FILES['userfile']['name'];
}
/* ...or... */
move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'], "/place/to/put/uploaded/file");
?>
The PHP script which receives the uploaded file should implement whatever logic is necessary for determining what should be done with the uploaded file. You can for example use the $HTTP_POST_FILES['userfile']['size'] variable to throw away any files that are either too small or too big. You could use the $HTTP_POST_FILES['userfile']['type'] variable to throw away any files that didn't match a certain type criteria. Whatever the logic, you should either delete the file from the temporary directory or move it elsewhere. The file will be deleted from the temporary directory at the end of the request if it has not been moved away or renamed.
我就用过中文名字的啊的上传文件了
不过不能超过2MB的<?
.
.
.
copy("$file","目录/$file_name");
unlink($file);
.
.
.
?>
我上传一个文件扩展名为.exe的文件,我给它起的名字是
“测试test.exe”,上传时没有问题在上传时,我用了个函数urlencode(),可我在将这个文件下载时它的文件名就变成了"test.exe",它自动就把“测试”省略了,那我怎么做才能使它的文件名部发生变化!!!!