php 图片上传问题 传上去的图片让他不重新命名

来源:百度知道 编辑:UC知道 时间:2024/05/28 01:09:01
<?php
$uptypes=array('image/jpg', 'image/jpeg',
'image/png',
'image/pjpeg',
'image/gif',
'image/bmp',
'application/x-shockwave-flash',
'image/x-png');
$max_file_size=5000000;
$destination_folder="../img/";
$watermark=0;
$watertype=1;
$waterposition=1;
$waterstring="newphp.site.cz";
$waterimg="xplore.gif";
$imgpreview=1;
$imgpreviewsize=1/2;
?>

<style type="text/css">body,td{font-family:tahoma,verdana,arial;font-size:11px;line-height:15px;background-color:white;color:#666666;margin-left:20px;}
strong{font-size:12px;}
a:link{color:#0066CC;}
a:hover{color:#FF6600;}
a:visited{color:#003366;}
a:active{color:#9DCC00;}
table.itable{}
td.irows{height:20px;background:url("index.php?i=dots") repeat-x bottom}<

楼上的已经改了文件名了。虽然我也同意你的作法。或许楼许要的是这个

$destination = $destination_folder.time().".".$ftype;

改为:
$destination = $destination_folder.$file["name"];

修改下面这一行即可:
$destination = $destination_folder.time().".".$ftype;

修改为:
$destination = $destination_folder.basename($file["name"]);

后面加个时间戳 .time()