View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0034949 | mantisbt | attachments | public | 2024-11-05 16:12 | 2024-11-13 07:25 |
| Reporter | rogueresearch | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | have not tried |
| Status | feedback | Resolution | open | ||
| Product Version | 2.27.0 | ||||
| Summary | 0034949: Max attachment size should scale to larger units in user interface | ||||
| Description | Since (I think) 0027700, mantis is using base 2 instead of base 10 for sizes. First, for file attachments, I think this is the wrong choice. Most OSes use base 10 for file sizes, Windows is the only exception, see for example https://randomascii.wordpress.com/2016/02/13/base-ten-for-almost-everything/ Anyway in my config file I had
and the mantis UI shows "Maximum size: 97,656 KiB" so I changed my config file to:
and now the mantis UI shows "Maximum size: 102,400 KiB" In neither case does it show a nice round number. I'd like it to say "Maximum size: 100 MiB". Of course Apple and Unix users will all be confused anyway because their OS uses base 10. | ||||
| Tags | No tags attached. | ||||
An "exception" that still had over 75% of market share, last time I checked.
Really ? IMO that depends on the context and tools used. This is my world (sorry I'm a CLI guy):
And it's also worth mentioning that if you set upload_max_filesize or post_max_size to But let's leave the opinionated debate of whether file sizes should be measured in 10^3 or 2^10 based increments aside. We have settled on IEEE 1541 binary units for MantisBT in 0027700, and I personally don't see any compelling reason to change that. What matters is that we are reporting the numbers as KiB which is unambiguous (unlike KB which can be misinterpreted) - and if you hover your mouse above them, you'll even see the actual size in bytes. In any case, I don't think that's the point of your request. If I understand correctly, you just want $g_max_file_size to be displayed in a "human-readable" format, e.g. 1024 bytes as 1 KiB, 1'048'576 bytes as 1 MiB, etc, which should be feasible fairly easily by adapting print_max_filesize() function to use a dynamic unit depending on the config's actual value. Something like this:
Is this what you expect? As a side note, are you really allowing 100 MB file attachments !? |
|