Attachments are automatically renamed on the backend

Whenever a user drags an attachment from a document to another document

or

when attaching files to a document that already has the same named attachment in that document…

the new file will be renamed in the background to a name with random characters.

So now…when using any of the following…

-@AttachmentNames

-notesEmbeddedObject.Name

-Looking anywhere in $file

-Even looking in the Rich Text field that represents the attachment

do NOT show the orginal name. You can still see the name in the image that is in the richtext field that everyone sees, but it is just an image. When the file is detached, you then, and only then, get the orginal name.

I simply need a way to get the orginal name (before detaching).

Finding a programmatic method appears to be a losing battle, although I think C API would have some possibilities.

Subject: Attachments are automatically renamed on the backend.

  • The bit about renaming when the same file is attached again is a “feature” that’s been in Notes since I started using it over six years ago. It’s not going away, it seems. The renaming isn’t bad, in and of itself, but:A) They could have done a better job on the new name, like <old_name>_a or something useable.

B) They could have cached the original name somwhere visible. They obviously do cache it; I wasn’t aware that detaching the file manually returned it to its original name. I thought it was just hosed forever.

  • I thought embeddedObject.Source had the file name in it? Have you tried that?

  • Hope this helps…

Subject: RE: Attachments are automatically renamed on the backend.

What’s even more annoying is that the generated names loose their extension. So, if you build a list for webusers with attachment filenames as anchorlinks, the links become unusable.