Unable to display text files larger than 8mb #3944

Closed
opened 2025-11-02 05:31:21 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @multinerd on GitHub (Sep 12, 2019).

  • Gitea version (or commit ref): 1.9.3
  • Git version: 2.23.0
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • [X ] MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • [X ] Not relevant
  • Log gist:

Description

Setting a value for MAX_DISPLAY_FILE_SIZE in app.ini does not override the default 8mb.
I haven't done any GO development as yet, but looking at the code, it seems that the value is hard-coded

Setting MAX_DISPLAY_FILE_SIZE = 1048576 in app.ini still produces the The file is too large to be shown. message.

Screenshots

I think you know what that message looks like, but i can take a screenshot if required.

Originally created by @multinerd on GitHub (Sep 12, 2019). - Gitea version (or commit ref): 1.9.3 - Git version: 2.23.0 - Operating system: - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [X ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X ] Not relevant - Log gist: ## Description Setting a value for `MAX_DISPLAY_FILE_SIZE` in `app.ini` does not override the default 8mb. I haven't done any GO development as yet, but looking at the code, it seems that [the value is hard-coded](https://github.com/go-gitea/gitea/blob/f1c414882cbbdb22c6bcc6315c03a1d3c8454164/modules/setting/setting.go#L191) Setting `MAX_DISPLAY_FILE_SIZE = 1048576 ` in `app.ini` still produces the `The file is too large to be shown.` message. ## Screenshots I think you know what that message looks like, but i can take a screenshot if required.
GiteaMirror added the issue/stale label 2025-11-02 05:31:21 -06:00
Author
Owner

@guillep2k commented on GitHub (Sep 13, 2019):

I don't know about your issue, but just for clarifying the information, the following line maps the contents of app.ini into the UI settings:

https://github.com/go-gitea/gitea/blob/f1c414882cbbdb22c6bcc6315c03a1d3c8454164/modules/setting/setting.go#L897

It's an automated procedure that uses reflection to discover the proper member/value pairs. That's why you don't see the specific initialization code for that member. What you've pointed out is the default value.

As I've said, I don't know what's the actual cause of your issue, though.

@guillep2k commented on GitHub (Sep 13, 2019): I don't know about your issue, but just for clarifying the information, the following line maps the contents of app.ini into the UI settings: https://github.com/go-gitea/gitea/blob/f1c414882cbbdb22c6bcc6315c03a1d3c8454164/modules/setting/setting.go#L897 It's an automated procedure that uses reflection to discover the proper member/value pairs. That's why you don't see the specific initialization code for that member. What you've pointed out is the default value. As I've said, I don't know what's the actual cause of your issue, though.
Author
Owner

@multinerd commented on GitHub (Sep 13, 2019):

Thanks for sharing that bit of info. I guess ill have to dig a bit further. Maybe i should learn GO while im at it :)

@multinerd commented on GitHub (Sep 13, 2019): Thanks for sharing that bit of info. I guess ill have to dig a bit further. Maybe i should learn GO while im at it :)
Author
Owner

@stale[bot] commented on GitHub (Nov 12, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Nov 12, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3944