Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"The given data was invalid" when uploading a GLB file [4.57.0] #10069

Closed
espenlg opened this issue May 14, 2024 · 2 comments
Closed

"The given data was invalid" when uploading a GLB file [4.57.0] #10069

espenlg opened this issue May 14, 2024 · 2 comments
Labels

Comments

@espenlg
Copy link
Contributor

espenlg commented May 14, 2024

Bug description

I'm having problems uploading GLB-files to the assets container. I've tried to disable the automatic image processing just in case, and I've tried both on my local dev-environment and on the production-environment, but still the same. Uploading other non-image files as PDF or MP4 is not a problem. File size is not the issue, it is well within the configured limits.

This is a screenshot from CP;
Screenshot 2024-05-14 at 12 50 05

..and this is what the POST request returns:
Screenshot 2024-05-14 at 12 50 44

How to reproduce

In short - try to upload a file with extension .glb to the assets container. It doesn't have to be an actual .glb 3d-model file, I tried to rename a jpg to glb just to check and I get the same error.

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 10.48.7
PHP Version: 8.2.16
Composer Version: 2.7.2
Environment: local
Debug Mode: ENABLED
URL: cody.test
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 0
Antlers: runtime
Sites: 2 (Norsk, English)
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.57.0 PRO

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

@duncanmcclean
Copy link
Member

In #9037, we introduced some validation to prevent files with unwanted file extensions being uploaded without being specifically whitelisted.

The .glb file extension is not part of the file extensions whitelist in Statamic. However, you can add additional file extensions as needed, in your config/statamic/assets.php config file:

/*
|--------------------------------------------------------------------------
| Additional Uploadable Extensions
|--------------------------------------------------------------------------
|
| Statamic will only allow uploads of certain approved file extensions.
| If you need to allow more file extensions, you may add them here.
|
*/

'additional_uploadable_extensions' => [
    'glb',
],

@espenlg
Copy link
Contributor Author

espenlg commented May 14, 2024

Thank you for clearing that up @duncanmcclean 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants