[GH-ISSUE #15260] feat: remove s3 uploads from local storage #56179

Closed
opened 2026-05-05 18:53:48 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @louis-fiori on GitHub (Jun 24, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/15260

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

We’re currently using the S3 storage provider in OpenWebUI to comply with internal data retention and compliance requirements. Specifically, all uploaded files must reside exclusively in S3.

However, we noticed that while the S3 provider does upload the file to S3 successfully, the file also remains on the local container’s storage. This creates a compliance issue for us, as files must not persist outside of S3.

Desired Solution you'd like

We propose adding a configuration option to automatically delete the local file after a successful upload to S3.

The update could be made in the storage/provider.py file, within the upload_file method of the S3StorageProvider.

def upload_file(self, file_path: str, file_name: str) -> str:
    ...
    self.s3.upload_file(file_path, self.bucket_name, s3_key)
    
    if self.delete_after_upload:
        os.remove(file_path)

This could be controlled via an environment variable (e.g., S3_DELETE_LOCAL_AFTER_UPLOAD=True), or a config flag.

Alternatives Considered

We are currently manually deleting the files after upload via a patch, but this is not ideal or maintainable long-term.

Additional Context

No response

Originally created by @louis-fiori on GitHub (Jun 24, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/15260 ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description We’re currently using the S3 storage provider in OpenWebUI to comply with internal data retention and compliance requirements. Specifically, all uploaded files must reside exclusively in S3. However, we noticed that while the S3 provider does upload the file to S3 successfully, the file also remains on the local container’s storage. This creates a compliance issue for us, as files must not persist outside of S3. ### Desired Solution you'd like We propose adding a configuration option to automatically delete the local file after a successful upload to S3. The update could be made in the [storage/provider.py](https://github.com/open-webui/open-webui/blob/main/backend/open_webui/storage/provider.py) file, within the upload_file method of the S3StorageProvider. ``` def upload_file(self, file_path: str, file_name: str) -> str: ... self.s3.upload_file(file_path, self.bucket_name, s3_key) if self.delete_after_upload: os.remove(file_path) ``` This could be controlled via an environment variable (e.g., S3_DELETE_LOCAL_AFTER_UPLOAD=True), or a config flag. ### Alternatives Considered We are currently manually deleting the files after upload via a patch, but this is not ideal or maintainable long-term. ### Additional Context _No response_
Author
Owner

@tjbck commented on GitHub (Jun 25, 2025):

PR Welcome, however, just so you know when the file is needed it'll be downloaded to the instances.

<!-- gh-comment-id:3003505892 --> @tjbck commented on GitHub (Jun 25, 2025): PR Welcome, however, just so you know when the file is needed it'll be downloaded to the instances.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#56179