Skip to content

Issue 53027: Cannot insert a row into a sample type if Allowed File Extensions set, no file is provided#6677

Merged
labkey-danield merged 15 commits intodevelopfrom
fb_allowFileExtensionAutoTest
Jun 10, 2025
Merged

Issue 53027: Cannot insert a row into a sample type if Allowed File Extensions set, no file is provided#6677
labkey-danield merged 15 commits intodevelopfrom
fb_allowFileExtensionAutoTest

Conversation

@labkey-jeckels
Copy link
Copy Markdown
Contributor

Rationale

We are being too picky about file uploads.

Related Pull Requests

Changes

  • Skip over file form elements where no file was selected
  • Stop asserting about file extensions in makeLegalName(), which isn't necessarily creating a file
  • Improve error messaging when an illegal file extension is uploaded
  • Minor code cleanup

Copy link
Copy Markdown
Contributor

@labkey-adam labkey-adam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR, but should we consider a site validator or similar that checks existing attachments for undesired extensions?

@labkey-jeckels
Copy link
Copy Markdown
Contributor Author

Not for this PR, but should we consider a site validator or similar that checks existing attachments for undesired extensions?

I added a new metric, modules.Core.allowListCounts.FileExtension, so we can monitor the adoption of this feature. There's probably a lot that people would want to fully lock things down.

Note that I had to remove the assert that was checking for allowed extensions when writing files to the server. Otherwise things like folder exports quickly failed unless you added all of the various extensions they'd produce.

@labkey-danield labkey-danield merged commit 4a731cb into develop Jun 10, 2025
8 checks passed
@labkey-danield labkey-danield deleted the fb_allowFileExtensionAutoTest branch June 10, 2025 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants