Wiki: Files are not downloadable #11674

Closed
opened 2025-11-02 09:44:19 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @bauermarkus on GitHub (Sep 18, 2023).

Originally assigned to: @rafaelsgirao on GitHub.

Description

I tried to provide some files in the wiki via the link markdown

So I cloned the repo, I added a new folder, added the files and linked them as described here

When you click the link, the wiki opens a new page

Gitea Version

1.20.1

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Docker

Database

None

Originally created by @bauermarkus on GitHub (Sep 18, 2023). Originally assigned to: @rafaelsgirao on GitHub. ### Description I tried to provide some files in the wiki via the link markdown So I cloned the repo, I added a new folder, added the files and linked them as described [here](https://gist.github.com/subfuzion/0d3f19c4f780a7d75ba2) When you click the link, the wiki opens a new page ### Gitea Version 1.20.1 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Docker ### Database None
GiteaMirror added the issue/confirmedtype/feature labels 2025-11-02 09:44:19 -06:00
Author
Owner

@BElluu commented on GitHub (Sep 19, 2023):

Something is wrong with method WebPathToGitPath in file ./services/wiki/wiki_path.go
@bauermarkus if you need access to your files in wiki pages, for now you can create link like this:
For example, if your main branch is named master, files is directory in root
[Link name](/raw/branch/master/files/MyFile.pdf "Test Alt text")

@BElluu commented on GitHub (Sep 19, 2023): Something is wrong with method **WebPathToGitPath** in file _./services/wiki/wiki_path.go_ @bauermarkus if you need access to your files in wiki pages, for now you can create link like this: For example, if your main branch is named master, files is directory in root `[Link name](/raw/branch/master/files/MyFile.pdf "Test Alt text")`
Author
Owner

@bauermarkus commented on GitHub (Oct 27, 2023):

@BElluu Thanks a lot. But if I do that, I get a 404

@bauermarkus commented on GitHub (Oct 27, 2023): @BElluu Thanks a lot. But if I do that, I get a 404
Author
Owner

@rafaelsgirao commented on GitHub (Mar 11, 2024):

I'm interested in fixing this bug and would like to open a pull request soon.

I managed to reproduce this locally and made a proof-of-concept fix, which, at first glance, seems to work:
Relative links to files which are not registered as renderable by Gitea now feature a raw link instead of a regular wiki link.

Before:
image

After:
image

For reference, this is the wiki markdown file I created for testing ( Home.md ):

Welcome to the Wiki.

[Test file](files/test-file.zip "An ordinary test file")
@rafaelsgirao commented on GitHub (Mar 11, 2024): I'm interested in fixing this bug and would like to open a pull request soon. I managed to reproduce this locally and made a proof-of-concept fix, which, at first glance, seems to work: Relative links to files which are not registered as renderable by Gitea now feature a raw link instead of a regular wiki link. Before: ![image](https://github.com/go-gitea/gitea/assets/7544832/25350c77-c176-4cdb-9f13-e4f79edc5afd) After: ![image](https://github.com/go-gitea/gitea/assets/7544832/8d507fed-8c8d-4184-bedb-774f1a479c85) For reference, this is the wiki markdown file I created for testing ( `Home.md` ): ```markdown Welcome to the Wiki. [Test file](files/test-file.zip "An ordinary test file") ```
Author
Owner

@lunny commented on GitHub (Apr 10, 2024):

Since it's not by design in previous versions, I think feature is a better label for this issue.

@lunny commented on GitHub (Apr 10, 2024): Since it's not by design in previous versions, I think feature is a better label for this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11674