Replies: 1 comment
-
I second this. I am currently working on a tiny project, in which restricting the size would be the perfect solution to stop the client from uploading 5mb images. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to implement file type restrictions and file size restrictions for all Media for Repo Based uploads through a new addition to the
./tinacms/config.js
file.File Size Restrictions
I want to restrict the file size of uploaded media as I know my client will try to upload large files. I use Git LFS and want to prevent them for doing so for the sake of their SEO and to save space on the GitHub server overtime.
As per the code I saw TinaCMS utilises react-dropzone which after looking at their docs I saw you can apply custom validations, for instance, file size, file name, etc: https://react-dropzone.js.org/#!/Custom%20validation
My feature request is to allow a me as a developer to add a configuration line to my
./tinacms/config.js
that specifics the max file size, whether in bytes, mbs, whatever makes most sense.An example configuration option:
File Type Restrictions
I also want to configure TinaCMS to add a blacklist of files to disallow my client to upload certain file types to the server.
I noticed a general whitelist exists (as seen in the TinaCMS codebase) but I want to create a feature that allows me within the
tinacms/config.js
to stop certain file type uploads. I see the acceptance configuration occurs here in the code.An example configuration option:
Concluding Statement
File type and file size restrictions would be super useful as it prevents the user from uploading ridiculously sized images or files that I do not want to allow. It will allow more fine grained control over files uploaded to Repo Based media for developers like myself. Would be interested to hear thoughts from others.
Thanks to the TinaCMS team for creating an awesome project, I will be using TinaCMS as a trial with a smaller client within the next month.
Beta Was this translation helpful? Give feedback.
All reactions