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

Store file size along with attachments #40

Open
xinranh2 opened this issue Feb 29, 2020 · 1 comment
Open

Store file size along with attachments #40

xinranh2 opened this issue Feb 29, 2020 · 1 comment

Comments

@xinranh2
Copy link
Contributor

We want to store the size of a file uploaded for clients to be able to restrict how large uploads are and notify users of how large file is before loading images when the website runs.

Once this is done:

  1. Size of uploaded files will be stored in database
  2. API requests for attachments will include file size information
  3. Include a migration for updating information of already existing attachments

possible code: size = models.IntegerField(blank=True, )

@BenSturmfels
Copy link
Contributor

Hi @xinranh2, it would be good to get some more detail on the problem you're looking to solve here.

Regarding limiting the size of uploaded files, I believe that's covered in #38. Storing the file size in the database won't necessarily help here, since you would probably just reject the upload outright.

Regarding storing the file size in the database to relay back to people who may download it - is the reason you can't read this from the filesystem that the files are stored externally, eg. S3?

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

2 participants