On /admin/config/media/file-settings, Maximum Upload Size description says "Enter a value like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes) in order to restrict the allowed file size."

So I tried entering in 1 MB or 1 KB, but it saves it as 1 byte.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jody Lynn created an issue. See original summary.

cilefen’s picture

Curiously I can't reproduce this on a reference development site. "MB" and "KB" work, both in terms of saving the settings form (Do you literally mean /admin/config/media/file-settings? There is no setting there but it's on the file field configuration—I'm assuming that one), and in actual use, i.e. validating.

Jody Lynn’s picture

Project: Drupal core » File Entity (fieldable files)
Version: 8.4.x-dev » 8.x-2.x-dev
Component: file system » Code

Ah, thanks. This is coming from file_entiy module not core.

Jody Lynn’s picture

I think it is because file_entity.schema.yml specifies max_filesize type to be integer and it should be string.

cilefen’s picture

Sounds likely.

awaiskazimi’s picture

I have just developed a small patch to fix the issue.

  • joseph.olstad committed 6be77b18 on 8.x-2.x
    Issue #2894662 by awaiskazimi, Jody Lynn, cilefen: Max file size ignores...
joseph.olstad’s picture

Assigned: Unassigned » Berdir
Status: Active » Needs review

I've pushed this into the dev branch. With that said, would a hook_update be needed to fix this for existing installations?

The fix seems like it will fix new installations but what about existing ones?

joseph.olstad’s picture

Version: 8.x-2.x-dev » 8.x-2.0-rc2
Assigned: Berdir » Unassigned
Status: Needs review » Fixed

Included in rc2

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.