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

Filefield file extension constraints #73

Open
mjjeon opened this issue Dec 15, 2020 · 1 comment
Open

Filefield file extension constraints #73

mjjeon opened this issue Dec 15, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@mjjeon
Copy link

mjjeon commented Dec 15, 2020

It would be good to set acceptable file extensions in FileFields. If you set it only to accept txt or csv file formats, when a user tries to load a file with other file formats then appyter can alert the user can't load that file.

@u8sand u8sand added the enhancement New feature or request label Dec 15, 2020
@u8sand
Copy link
Collaborator

u8sand commented Dec 15, 2020

Related to #40
Assuming you express your filename constraints as a regex, for example:

FileField(
  ...,
  constraint=r'\.(txt|csv|tsv)$',
  ...,
)

This will prevent things server side, but with #40 we can translate this into a front-end validator as well.

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

No branches or pull requests

2 participants