
June 16th, 2004, 02:06 AM
|
|
Registered User
|
|
Join Date: Jun 2004
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
PHP Upload Script / What changes i have to do?
Hello Everybody
I have to change the following Upload Script, that when I upload a File, instead of
renaming in filename_01, overwriting the existing file. I'm a PHP-Newbie and don't know what
I have to do. I think it's the line with "$newname = basename" in this episode of the script. Thx for help! :-)
PHP Code:
/* * * TASK = UPLOAD * */ if(!empty($uploadfile)) { $newname = basename ($this->filehandler->func_upload(array("data"=>0,target=>"$dir/"))); $size= filesize("$dir/$newname"); $comment = t3lib_div::GPvar('comment'); if($newname) { $this->insert_file_entry("FILE",$reldir,$newname,$size,$comment); } else { $content .= "<p class='error'>".$this->pi_getLL("error")."</p>"; } }
|