Gossamer Forum
Home : Products : Others : Fileman :

How would one restrict the file upload types

Quote Reply
How would one restrict the file upload types
Suppose the upload has to be restricted to say .doc. .pdf and .txt extensions disallowing other extensions.

How can this be achieved in FileMan single user version? (The one that comes with GM).

Thnx

Anup
Quote Reply
Re: [anup123] How would one restrict the file upload types In reply to
Is this so difficult to implement. Actually i saw this feature on another file manager script so I just was eager to know if it could be implemented and including display of error message if the user tries to upload anything other than allowed extensions....

Anup
Quote Reply
Re: [anup123] How would one restrict the file upload types In reply to
A quick hack...line 779 /admin/GT/FileMan/Commands.pm just below:

Code:
$fullfile = $file->{file};

...add....

Code:
($fullfile =~ /\.(doc|pdf|txt)$/i) or return $self->cmd_main_display({ reload => 1, status => sprintf($LANGUAGE{ERR_INVALID},$fullfile)});

Last edited by:

Paul: May 1, 2003, 3:46 AM
Quote Reply
Re: [Paul] How would one restrict the file upload types In reply to
Thnx Paul... i would try and see for myself. Actually threre is this 20$ (I am not posting name and company in public) script which does all this from Admin and offers individual directories to each user so i was just seeing the demo version of that.

Though not in right forum, the minimum characters in Password of GM did not work unfortunately.

Anup