Hi Martin, try editing the if statement at line 134:
if ($parts[1] == 'doc' || $parts[1] == 'pdf' || $parts[1] == 'docx') {😊
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
September 30, 2009 4:57pm
Subscribe [6]#16 / Mar 10, 2010 6:49pm
Hi Martin, try editing the if statement at line 134:
if ($parts[1] == 'doc' || $parts[1] == 'pdf' || $parts[1] == 'docx') {😊
#17 / Mar 10, 2010 10:40pm
Thanks a lot Nathan. Just one more question if possible. You mentioned setting the file name to the original. Could it also be set to the member_id of a logged in user?
Regards
Martin
#18 / Mar 11, 2010 5:17am
You’d probably need to do something along the lines of swapping out the code below at about line 125:
//get new location
$microtime = $this->microtime_float();
$file_name = md5($parts[0].$microtime).'.'.$parts[1];
$upload_path = $upload_path_setting.'/'.$file_name;for something more like:
//get new location
$file_name = $member_id.'.'.$parts[1];
$upload_path = $upload_path_setting.'/'.$file_name;If I ever get a chance, next time I’m working on this I’ll add some an option to allow control of file name via the settings screen for the extension.
😊
#19 / Mar 11, 2010 6:25am
I can’t thank you enough Nathan 😊