Special characters in attachment filenames

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
macula
Posts: 167
Joined: Mon Oct 19, 2009 1:14 pm

Special characters in attachment filenames

Post by macula »

Hi Jon,

In order to produce a valid filename, the "rename attachment" facility in Bookends filters out the colon (:) and replaces it with the hyphen (-). For example, a string such as:

Code: Select all

A title: A subtitle
would be converted to a filename such as:

Code: Select all

A title-A subtitle.pdf
May I ask that you consider filtering out the backslash (\), as well? Although the MacOS filesystem permits the backslash in filenames, Dropbox refuses to sync any such files, probably because they would be invalid in Windoze filesystems. (Curiously, though, Dropbox does sync filenames with other "problem" characters, e.g. the question mark.)

A comparative survey of filename rules across OSs appears at http://support.grouplogic.com/?p=1607. According to this source:
The following characters are invalid as file or folder names on Windows using NTFS:
/ ? < > \ : * | ” and any character you can type with the Ctrl key

In addition to the above illegal characters the caret ^ is also not permitted under Windows Operating Systems using the FAT file system.
I do not know how Dropbox fares with cross-platform filename synchronization in every case, but the backslash certainly causes problems.

Thank you.
Jon
Site Admin
Posts: 10292
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Special characters in attachment filenames

Post by Jon »

Hm, that is odd. Have you contacted DropBox tech support to see if this is intentional, or a bug?

Jon
Sonny Software
macula
Posts: 167
Joined: Mon Oct 19, 2009 1:14 pm

Re: Special characters in attachment filenames

Post by macula »

No I haven't, and Dropbox support is not nearly as speedy as Bookends Support, I'm afraid.

It certainly boils down to the backslash in the filename though, because:

1. Removing the contentious character from the filename instantly resolves the issue, and restoring the character instantly reproduces the issue.
2. Removing the extended attributes of the attachment (using xattr) does nothing to solve the issue, so we can eliminate the possibility of permissions issues etc.

Bug or not, how about just filtering out the backslash? It is quite an uncommon character to have in an attachment filename, anyway. The only reason it appears frequently in my database is that my attachments are automatically named after their title, and many of the titles contain backslash-prefixed LaTeX commands (e.g. \mkemph{…}).
Jon
Site Admin
Posts: 10292
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Special characters in attachment filenames

Post by Jon »

Taking out the backslash isn't hard of course, but I'm loathe to remove all the characters mentioned, especially because they are useful characters in many file names. I'm surprised that they worked for you but the backslash didn't (which is why I think it might be a bug). I'll filter out backslash in the future, but I'd like to stop there.

Jon
Sonny Software
macula
Posts: 167
Joined: Mon Oct 19, 2009 1:14 pm

Re: Special characters in attachment filenames

Post by macula »

Thanks, Jon, I'll be looking forward to the update. I agree that removing all other contentious characters would be overkill.
macula
Posts: 167
Joined: Mon Oct 19, 2009 1:14 pm

Re: Special characters in attachment filenames

Post by macula »

UPDATE: My request for more information on the Dropbox forums (not the official Dropbox support, yet many Dropbox developers hang out there) did not yield anything useful. None of the responders could explain the behavior, so this could indeed be a bug.
Nhaps
Posts: 252
Joined: Mon Sep 26, 2011 10:05 pm

Re: Special characters in attachment filenames

Post by Nhaps »

Is it possible to have BE replace the colon (:) with period (.) plus space rather than hyphen (-)? I am wondering how to go about making this change
Jon
Site Admin
Posts: 10292
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Special characters in attachment filenames

Post by Jon »

In the formatter? No, that's not possible. You'd have to do that yourself (find/replace) in the database.

Jon
Sonny Software
Post Reply