Open alexglue opened 9 years ago
private function getFilename() {
switch (config('media.config.rename')) {
case 'transliterate':
$this->filename_new = \Transliteration::clean_filename($this->filename_original);
break;
case 'unique':
$this->filename_new = md5(microtime() . str_random(5)) .'.'. $this->filename_original;
break;
case 'nothing':
$this->filename_new = $this->file->getClientOriginalName();
break;
}
return $this->fileExistsRename();
}
This is bad code. And I can do nothing to overload it, cause it's private.
I can do nothig to extend filename generation with my own function, md5() etc.
You could make a pull request..
Could u please to add simple md5() renaming without part of original name? And it will be nice to store files to subdirectories in this case, like
/public/de/ad/be/ef/12/bb/ce/ed/deadbeef12bbceed.jpg
for example.