goodhunting
Karma: 1
|
Random filename for upload file!! - 2011/07/01 05:32
I would like to upload a file and hope that it's filename can be modified as random name , therefore I have modified the source code of remositoryFile.php program as below :
public function obtainPhysical () { $physical = new remositoryPhysicalFile(); if ($this->oldid == $id) $this->realname = (((double)microtime() * time()) * 10000).stristr($this->realname,"."); $physical->setData($this->filepath.$this->realname, $this->id, $this->isblob, $this->plaintext, $this->realwithid); return $physical; }
I had tested the function from backend , the result is good and the showed filename is the same as the filename on disk , but when I upload the file from frontend , the showed filename on the screen is not consistent with the filename on disk . The problem will lead to "file not found" error when I try to download the uploaded file . Please advise how to solve this problem ? thank you very much !!
|