Skip to content

[Feature] - Overall file Upload Limit to File Storage Service in MBs (Appwrite Buckets) #363

Closed

Description

@punitdiwan

Add file Upload Overall Limit to File Storage Service in MBs per project. On GUI side, we can add this feature in per Project Settings. It will be good to have this feature. If this feature is added, I can limit my clients from uploading unnecessary files. Because clients don’t delete files and just keep on uploading photos or pdfs. It get piled up and eats server space. Limit will force then to delete old stuff.

Hope other community members also agrees.Hoping to see this feature implemented.

Thanks,
Punit

Activity

  1. changed the title [-][Feature] - Monthly file Upload Limit to File Storage Service in MBs[/-] [+][Feature] - Overall file Upload Limit to File Storage Service in MBs[/+] on May 30, 2020
  2. eldadfux commented on May 30, 2020

    @eldadfux
    Member

    Me and @christyjacob4 just talked about this as part of a buckets feature (like storage directories) where each bucket has properties like rules. One feature we talked about was limit for a single uploaded file. Maybe having a limit per directory or per project could also be useful. @christyjacob4 what do you say?

  3. added
    discussion
    enhancement
    on May 30, 2020
  4. christyjacob4 commented on May 30, 2020

    @christyjacob4
    Contributor

    @eldadfux I suggest that we can have rules per storage bucket.

    storage
    |----- Bucket 1
                |-------- file1.jpg
                |-------- file2.jpg
    |----- Bucket 2
    |----- Bucket 3

    For Bucket 1 , we can have rules as follows

    {
        filetypes : ['jpg', 'png', 'gif'],
        maxFileSize : 1000 (in whatever units comfortable),
        security : true/false (whether to check each file uploaded to this bucket for viruses or malicious content),
        roles : [] (the list of roles which can access this bucket)
    }

    We would not want to do it per project because that would take away the flexibility of having rules per bucket.
    WDYT @eldadfux ?

  5. eldadfux commented on May 30, 2020

    @eldadfux
    Member

    I am trying to think about what conflicts we would have if we were to implement both scopes of limits one per project and one per bucket.

  6. eldadfux commented on May 30, 2020

    @eldadfux
    Member

    We also need to think about migration of existing data for users of Appwrite 0.6.*. We would probably create a 'default' bucket and assign all files to it.

  7. christyjacob4 commented on May 30, 2020

    @christyjacob4
    Contributor

    I am trying to think about what conflicts we would have if we were to implement both scopes of limits one per project and one per bucket.

    Is there a requirement to have two scopes of limits? Is there a scenario that cannot be covered by just having rules per storage bucket?

    We also need to think about migration of existing data for users of Appwrite 0.6.*. We would probably create a 'default' bucket and assign all files to it.

    This can be a good start and I'd like to add onto it.
    Let's say a project already has some storage data (in appwrite version < 0.6.*)

    With the update we migrate all that to a default storage bucket ( eg: Bucket 1) as you mentioned.
    Now, when this user creates a new storage bucket (i.e Bucket 2 ), we can give him an option "Would you like to move your existing files to this new bucket"

    If he agrees, we can move all his files from Bucket 1, that match the new rules , to Bucket 2..

  8. eldadfux commented on May 30, 2020

    @eldadfux
    Member

    I think we could just let him edit the default bucket (AKA Bucket 1) rules and name, that way we'll avoid any live data migration that are not part of the update+migration process between Appwrite versions.

  9. christyjacob4 commented on May 30, 2020

    @christyjacob4
    Contributor

    Okay yes I agree that we need to keep the migration simple. But my use-case was after the migration is done

    Here's the use-case once again.

    Bucket 1 contains
    file1.jpg
    file2.jpg
    file3.pdf
    file4.docx
    file4.png

    Lets say the user now creates a new bucket Bucket 2 and added the following rules

    {
      fileType : ['jpg', 'png']
    }

    We should provide an option "Hey do you want to also migrate your existing files which satisfy the rules from other buckets to Bucket 2?"

    Let me know if you need more clarity on the usecase?

  10. eldadfux commented on May 30, 2020

    @eldadfux
    Member

    Yeh, I think I get it. Same problem could also happen when you want to edit rules of an existing bucket, what will happen to files that don't follow the new updated rules?

  11. punitdiwan commented on May 30, 2020

    @punitdiwan
    Author

    @eldadfux and @christyjacob4 Regarding the file Buckets, what maxFileSize Rule denotes, will it be monthly or overall or its individual file size

  12. christyjacob4 commented on May 30, 2020

    @christyjacob4
    Contributor

    in that case, let's keep it this way. Once you create rules for a storage bucket , you CANNOT EDIT IT

    So if you feel you need to partition your files based on a different logic, you can ONLY create a new Bucket , where we provide the option to migrate the files .

    wdyt @eldadfux ?

  13. christyjacob4 commented on May 30, 2020

    @christyjacob4
    Contributor

    @punitdiwan I was thinking of individual file size. The biggest single file that can be uploaded to that bucket must be < maxFileSize.

    This is just a suggestion. We will discuss the pros and cons here before moving to the implementation

  14. eldadfux commented on May 30, 2020

    @eldadfux
    Member

    We can have both max file size and max bucket, don't see any reason to favor one over the other. Both can be pretty beneficial for different use-cases, like storage cost of abuse protection. I really like the idea of having both.

    Migrating files is something I would try to avoid at almost any cost. We won't be able to this smoothly with a big or even medium amount of files in a bucket during run time. The worst case is that this is a one time process as part of a planned upgrade where your data server data has been backed up in advance.

    I think that rules can be valid for new files being upload. If a developer decides to change the validation rules, He or she should be responsible for choosing what to do with existing files in the bucket + we provide all the API and tools for them to do what they want.

  15. punitdiwan commented on May 30, 2020

    @punitdiwan
    Author

    Thank you for considering Bucket Size Rule as well, it will help to solve my use case.

    Regarding Files migration to another bucket, since you are planning to make bucket rules immutable, I suggest you to allow users to download all the contents from a bucket in zip format. Once the user downloads all the contents of the bucket (for e.g. Bucket-1 ), he can delete bucket-1 and re-upload the content in bucket-1, after re-creating it, with new rules applied. I believe each project will have buckets with unique names.

    Hope you like my suggestions.

    Regards,
    Punit

  16. eldadfux commented on Jun 1, 2020

    @eldadfux
    Member

    @punitdiwan each user will be able to delete or create file using the existing API, so we have max flexibility in this area as of today.

    Zipping all the file on a storage bucket with gigabytes of data will kill an Appwrite server on low hardware or no scalability applied and will also potentially be a very slow process. As long as we have the API available, each developer can do whatever best fit his use-case, capacity and scaleability capabilities.

  17. eldadfux commented on Jun 1, 2020

    @eldadfux
    Member

    This is what we have so far for Bucket attributes:

    • Device / Location (local, FTP and more..)
    • Max File Size
    • Max Bucket Size (update on delete / on create)
    • Encryption
    • Allowed Files (per extension, mimetypes, or both?)
    • AntiVirus Scan (enabled/disabled) - Available only if setup hasn’t disable ClamAV
    • Read (permissions) maybe we can leave this only at file level?
    • Write (permissions) maybe we can leave this only at file level?
    • TTL for files
    • Max number of files

    Am I missing anything?

  18. punitdiwan commented on Jun 2, 2020

    @punitdiwan
    Author

    Max Bucket Size (update on delete / on create)

    I suggest add two Keys Max Bucket Size Renaming and Max Bucket Size Allowed. The Max Bucket Size Remaining ( updates on delete / on create) and Max Bucket Size Allowed remained fixed and will be defined on Bucket Creating time from API or Console.

    This will make the things more verbose.

  19. changed the title [-][Feature] - Overall file Upload Limit to File Storage Service in MBs[/-] [+][Feature] - Overall file Upload Limit to File Storage Service in MBs (Appwrite Buckets)[/+] on Jun 4, 2020
  20. TorstenDittmann commented on Jun 8, 2020

    @TorstenDittmann
    Contributor

    Just out of curiosity I can think of two things that might be useful as attributes:

    • TTL for files
    • Max number of files
  21. TorstenDittmann commented on Mar 3, 2022

    @TorstenDittmann
    Contributor

    We just released 0.13 and this should be fixed 👍🏻

    You can find the announcement here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

discussionenhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions