swfupload 上传后重命名 并获取新的文件名解决方法

WBOY
Release: 2016-06-13 11:58:16
Original
1037 people have browsed it

swfupload 上传后重命名 并获取新的文件名
swfupload 上传后重命名 并取新的文件名 
//$file_name = preg_replace('/[^'.$valid_chars_regex.']|\.+$/i', "", basename($_FILES[$upload_name]['name']));
$name=substr(md5(date("Ymdhis")),0,16);//名称是随机数
$type=strrchr($_FILES[$upload_name]['name'],".");//得到后缀
$file_name = $name.$type;
//$_SESSION['file_wjm']=$file_name;
我是这样修改的但上传重命名正常,获取文件名是空的。
高手指点
------解决方案--------------------
你 file_put_contiets('test.txt', print_r($_FILES, 1));
观察文件 test.txt 的内容,最好贴出来
------解决方案--------------------
手误
file_put_contents('test.txt', print_r($_FILES, 1));

加载接受上传的程序的开始处,目的是观察上传文件的信息
因为是 swfupload 上传,只能回显指定格式的信息
所以将上传文件的信息保存到文件,便于分析
------解决方案--------------------
呦   你也有用swfupload 呀.    我几年前 用过,  应该是没问题 . 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!