Home arrow Forum

Remository Forum

 


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 !!
  | | Sorry, you do not currently have permission to write here.
Gebus

Karma: 0  
Re:Random filename for upload file!! - 2011/12/07 09:31 Why don't you use "Real_With_ID" option ?
  | | Sorry, you do not currently have permission to write here.
goodhunting

Karma: 1  
Re:Random filename for upload file!! - 2012/01/06 06:54 Thank you very much first !
Because I can't upload Chinese file name . User must rename to none Chinese file name to upload file, so I want upload file can automatic rename to none Chinese file name.
  | | Sorry, you do not currently have permission to write here.

Login

Subscribe to Premium Support

Get priority support for Remository and Glossary, sign up now for a Premium Support monthly subscription:

Your Remository user name

Or purchase a year's support:

Your Remository user name

Recommended SEF

SEF Advance

Who is Online

Remository welcomes guests and visitors

We have 10 guest online