Gossamer Forum
Home : Products : Others : Fileman :

view file with '&' in the filename

Quote Reply
view file with '&' in the filename
Hi,

I'm using FileMan v 1.256. I would like to view a file with filenames '&', for example, a&b.txt. I noticed that there is a function in /GT/FileMan/Commands.pm called _safe_file, it always check the filename. I already change that line from
return -1 if ($self->{cfg}->{filename_check} and $file !~ m,^([-\w/. ]+)$,);

to
return -1 if ($self->{cfg}->{filename_check} and $file !~ m,^([&-\w/. ]+)$,);


So that i can upload and delete it. But I don't know what to change for viewing/opening a file w/ '&'.

Thanks

Wallace
Quote Reply
Re: [tkdcheng] view file with '&' in the filename In reply to
Hi,

There is an option called 'filename_check' in ConfigData.pm. If it's set to '0', then FileMan will allow special characters in file name.

TheStone.

B.
Quote Reply
Re: [TheStone] view file with '&' in the filename In reply to
Thank you for you reply. I would like to ask, what do I have to change in order to create/view/delete a directory name with a '&' in it? Because seems like i have to make the changes in the GT/FileMan.pm, GT/FileMan/Commands.pm and some html files. But i'm not sure where do i need to modify.

Thanks!

Wallace
Quote Reply
Re: [tkdcheng] view file with '&' in the filename In reply to
You don't have to change anything. Just simply set filename_check to 0 within ConfigData.pm, it will affect all commands. ie: you can have a '&' in directory/file name when creating/viewing/deleting.

TheSTone.

B.
Quote Reply
Re: [TheStone] view file with '&' in the filename In reply to
Thanks for your reply, but i already set all the filename_check = 0 in Commands.pm. And I tried to create a directory w/ a '&', but it said Input value has invalid characters : b&b
any ideas?

Wallace
Quote Reply
Re: [tkdcheng] view file with '&' in the filename In reply to
I tested it out, and it worked just fine. Are you using version 2.1.1?

TheStone.

B.
Quote Reply
Re: [TheStone] view file with '&' in the filename In reply to
No, I'm using FileMan v 1.256.

Wallace
Quote Reply
Re: [tkdcheng] view file with '&' in the filename In reply to
What do I need to change for FileMan v 1.256?

Thanks

Wallace
Quote Reply
Re: [tkdcheng] view file with '&' in the filename In reply to
This's really old version, and it's required a lot of changes to make it works. Why don't you upgrade it to version 2.xx which has more features and much better look?

TheStone.

B.