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

S3 storage does not respect max_length because of upload_to #35

Open
wontonst opened this issue Jun 19, 2019 · 0 comments
Open

S3 storage does not respect max_length because of upload_to #35

wontonst opened this issue Jun 19, 2019 · 0 comments

Comments

@wontonst
Copy link

Let's say you have:

models.ImageField(storage=s3, upload_to='myfolder', max_length=100)

If you were to pass it a file name of length 100, it will happily take it.

The pitfall is that in reality it's stored in the database as myfolder/[file name]

Since the db varchar is set to max 100, len('myfolder/') characters are cut from the end of the string

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

No branches or pull requests

1 participant