Link to file without copying to assets folder?

Is this possible? I really want to link to the original and not change its name. The original may also change, so having a stale copy in assets wouldn’t be helpful.

If I manually input a relative path Logseq adds in assets making the path invalid. Why change the user’s input in this case?

The files in question are PDFs which I will never annotate.

FIGURED IT OUT: It was the mysterious bang ! that drag&drop inserted before the link. What does this actually do?

1 Like

So, after a lot of fiddling around, this seems to be the only way to both refer to the original file AND display it in Logseq. Is this right?

![Test.pdf](../assets/../Test.pdf)

Both of these will link to the original file (in the graph folder) and display with the default viewer.

[Test.pdf](Test.pdf)
[Test.pdf](../Test.pdf)

I think it would be more straightforward if partial paths were assumed to start from the graph folder. There seems to be a lot of second guessing going on. In the second case, it seems like the .. is ignored as you can add as many as you like and the link still opens the file in the graph folder.

Not following ..\ above the root of a given folder is typically a security precaution. It can be very dangerous depending on the application.

That said I would also appreciate a convenient way to link to external files. Sometime things get buried, but they need to be where they are for whatever reason.

1 Like

Newbie here. So can I enter [displayed-filename] (full-path-of-file) and logseq will link (not attach) the file into my graph, and not copy it into the assets folder? I want to use logseq to index and help me find existing files, including large ones. I want to use logseq to replace OmniOutliner, in which format I have many notes with many links to large files that live in specific places on my disk. I don’t plan to do any sync’ing, in case that matters.

It’s a known bug, see Relative Paths in file links don't work (incorrect handling of double-dot ..) - #2 by RBR
They fixed it for audio, so it’s not about the security, and Logseq can access the system anyway.
Sadly this path issue breaks the Zotero plugin.

2 Likes

You can use the Logseq-localassets-plugin and trigger the /Embed non-asset file and choose the file you want. It should auto-detect the file type and render it correctly.

4 Likes

Thanks, that helps. Now I need to go learn how to get use github to get plugins, and then how to install them :slight_smile: … I won’t be offended (rather, to the contrary, would be very grateful) if you decide to take the time to explain how to do this, but I won’t presume this of you, and will have a go at learning from scratch.

Okay, I think I got it installed. Thanks!

@hkgnp Thank you, I think I have it working, i.e. I have the link inserted, and I think I have successfully avoided creating a page and copying to assets.
There are some things I do not understand:
Sometimes it inserts an exclamation point, and sometimes it inserts an icon of something, and always it inserts …/assets/ .
I don’t think I understand why these things happen when they do.
Also I find myself always deleting those three things each time because I don’t know why they are there.
Am I creating some problem, in my ignorance?

Are you using the “Embed non-asset file?”

I see, thanks. I was trying to follow the instructions in the Readme file (“Start by using the slash command /local audio or /local video”), rather than /Embed as you instructed in this thread. So I typed /loc and saw various things that looked like they might work, including versions for pdf and other documents.

Oh boy. I was missing so much background knowledge.
I spent several hours searching for an explanation of what the exclamation point was doing, but didn’t find anything, probably because I didn’t know how to search for it other than to google logseq "!" or logseq bang or logseq exclamation point.
I just asked someone who is a computer scientist and they pointed out that the bang is a feature of markdown, used when you want an image to render.

I’m also starting to realize that the terms “link” and “embed” have different implications in logseq compared to in, say, powerpoint (where “link” means something like “display the page on the other end of the link”; and “embed” means “balloon the size of the file by saving the video file right in your document”).

If I want to be able to refer to a .docx in a block, without logseq copying it to the assets folder, what is the best way to do that? Do I use /loc docs and then erase the added part of the pathname ../assets/..? Or do I use /link to get [label] (some-version-of-the-path)? Or since .md is just text anyway I could just type out [label] (some-version-of-the-path)?

I see that pdf files render nicely. I haven’t had any success rendering docx files, just opening them by clicking, so I assume that that isn’t supported?