Gossamer Forum
Home : Products : Others : Fileman :

Illegal Characters

Quote Reply
Illegal Characters
Is there a workaround to permit FileMan to recognize files with apostrophes in it? Whenever I attempt to open a folder with an apostrophe in the name I get the following error message:

<<<---------------------------->>>

A fatal error has occured:

work_path has invalid characters : B-52's at C:/#######/#######/cgi-bin/private/lib/GT/FileMan.pm line 58.


Please enable debugging in setup for more details.

<<<--------------------------->>>

Any help would be appreciated.

TIA

Tektoo
Quote Reply
Re: [Tektoo] Illegal Characters In reply to
Ok. I changed this part of line 58 in FileMan.pm:

m,^([-\w/. ]+)$

To:

m,^([-\w/. ']+)$

And the program will now open folders with apostrophes in them. Can anyone tell me how to allow it to accept downloads with apostrophes? I've tried several changes in Command.pm, but they either crash the program, or do nothing at all.

TIA

Tektoo
Quote Reply
Re: [Tektoo] Illegal Characters In reply to
Hi Tektoo,

I haven't tried this myself but try making the same changes in the _safe_file sub in Commands.pm, about line 2600.

~Charlie
Quote Reply
Re: [Chaz] Illegal Characters In reply to
Thanks for the thought Chaz, but that didn't do it. I think it's in the sub_valid_name_check, but I really know very little about Perl, so I have no clue what to change. Maybe it isn't as simple as I thought it might be. Do the developers ever review these threads? I could accept that it can't be easily done, but the silence is deafening.

Tektoo
Quote Reply
Re: [Tektoo] Illegal Characters In reply to
Hi Tektoo,

I just tried it myself with a filename of B-52's and it works for me. I am able to save and download the file. The only change I made was this: m,^([-\w/.' ]+)$, in the _safe_file sub. I'm not really sure why it's not working for you.

The developers are active in this forum most of the time. I think that The Stone, the one who normally moderates this forum, is working on something new and hasn't had much time to answer questions. That's purely speculation on my part though.

Sorry I couldn't be of more help :/

Regards,
Charlie
Quote Reply
Re: [Chaz] Illegal Characters In reply to
After re-reading your post, you mentioned a directory, not a file. Let me go back and look a little harder.

~Charlie
Quote Reply
Re: [Chaz] Illegal Characters In reply to
Chaz,

Thanks. I got it working. Here's how:

I had been so focused on the apostrophe being the problem, that when I added it to the line in Command.pl and tried it, I didn't notice there were also brackets "( )" in the file name. There's where my problem was. In the file choice. Once I made the line, (2595 in my script,) read:

m,^([-\w/.' ()]+)$

it worked fine.

I do appreciate your replies. They caused me to look deeper. Wink

Thanks.

Tektoo
Quote Reply
Re: [Tektoo] Illegal Characters In reply to
Well, I got it to work for directories but I think I broke a few things in the process. I made the same change you did to FileMan.pm and I also made the same changes I noted above to the _safe_dir sub in Commapnds.pm, around line #2691.

The problem is that I can't always access a dir with a ' in it. Sometimes I have to click on the root dir link in the top frame before it will let me in. Also, having the ' in the file name or dir name breaks some of the error messages. It looks like maybe the ' is breaking some of the links too.

It's not quite as easy as I thought it would be either.
Quote Reply
Re: [Tektoo] Illegal Characters In reply to
I'm glad I was able to help, I think :) I hope I didn't confuse you with the rest of my posts.

~Charlie
Quote Reply
Re: [Chaz] Illegal Characters In reply to
I'm having trouble with the download link now. I've changed the _safe_dir sub accordingly, and when I click on any link in the directory or sub directory it will download properly. However, if I check the corresponding check box, then click 'download', I get an error message.

I've not figured that part out yet.
Quote Reply
Re: [Tektoo] Illegal Characters In reply to
I think that's the ' breaking the links. A lot of the links are built internally with single quotes and when you have a single quote in the file or folder name, it breaks the link.

You would basically need to go through all of the FileMan modules and change all the links to use qq or double quotes and escape any double quotes in the link. Even then, I'm not sure if that's all that needs to be done.

~Charlie