Do attachment need to preserve the file extension in name?

When attaching a file, such as an image or document, is it necessary for the name to retain the file type/extension (.jpg, .pdf, etc) for full functionally? Or is this all handled in the Joplin directory (that randomish alphanumeric ID) which automatically indicates to the note what file type it is?


Is the second attachment in this screenshot going to have any issues due to the ".png" not being included?

No, a extension or name is in the markdown not necessary.
It wors also with ![](:/317ac48bbb9a345c8940d231894f775d) or ![crazy text](:/317ac48bbb9a345c8940d231894f775d)


Is the original file name preserved then in the Joplin attachment database? Or is it changed into that alphanumeric string?

Yes, right click on a image or file an save as and the original name is proposed.

It seems to depend on how you attach a file as to whether the filename is stored. If you attach using the toolbar icon the full name seems to be saved in the database. However using drag-drop/copy-paste can end up storing the URI as the filename or there's no name at all. I cannot be more accurate as I have not tested this, just observed it in passing.

It also seems that once the filename is stored it is fixed. So if you attach a file called, say, PIC012345.jpg it will appear in the note in the format [PIC012345.jpg](:/317ac48bbb9a345c8940d231894f775d). You can change the name to [Kitten964.jpg](:/317ac48bbb9a345c8940d231894f775d) in the note but when you Save As... Joplin will offer to save PIC012345.jpg.

I am exclusively a mobile user at this point. The only option there is to use "attach" from the drop-down menu, which methodology do you think this will be using?

Just tested it by creating a note on mobile, adding a picture, changing the name in the square brackets and syncing. I then opened the note on the desktop version and did a save as. Got prompted to save using the original name.

So it seems that Joplin mobile is using the attach method and saves the original file name in the database as it is when when you attach the file. You can write whatever you like in the square brackets afterwards (or make it blank). The info in the square brackets is a descriptor for the link and nothing to do with the stored attachment itself, just like with URLs. Which actually answers your original question!

Any subsequent "save as" from that note on a desktop client will suggest the original filename.

Taking a photo directly in Joplin however adds the image with an empty set of square brackets (as there is no filename to use as a descriptor) and no filename is stored against the attachment. You can type what you like in the square brackets as a descriptor but when you try a "save as" on that, (on a desktop client) the filename field is therefore empty.

1 Like