This module extends the functionality of fs_attachment to better support Amazon S3 storage. It includes features such as:
- Special handling of X-Accel-Redirect headers for S3 storages.
- Options for using signed URLs in X-Accel-Redirect. (This is required to be able to serve files from a private S3 bucket using X-Accel-Redirect without exposing the files publicly.)
- Enforcing the mimetype of files stored in S3.
auto_awesome What this module does
AI-generated from the code · Odoo 19.0This module lets Odoo store attachments in Amazon S3 and serve them securely through X-Accel-Redirect, with optional signed URLs and enforced file types.
This module extends the file storage system so that attachments can be kept in an S3-compatible bucket. On the storage configuration form, when the option to serve internal URLs via X-Accel-Redirect is enabled and the protocol is set to S3, two new fields appear: one to use signed URLs for X-Accel-Redirect and another to set the signed URL expiration time in seconds (default 30).
When an attachment is stored in S3, the module automatically sets the file's content type (MIME type) based on the attachment's mimetype, ensuring files are served correctly. It also changes how the X-Accel-Redirect path is built for S3 storages: instead of the standard path, it generates a path that includes the S3 scheme, host, and file location. If signed URLs are enabled, it creates a temporary presigned URL for the file, which is useful for private buckets that require authentication.
The module adds no new menus or screens of its own; it only adds fields to the existing storage configuration form. It works with the fs.storage and ir.attachment models. A post-migration script checks that the companion module fs_attachment_s3_environment is available and installs it if needed, to preserve environment-managed fields on storages.
Depends on
Required by other modules
Models and fields (2)
- fs.storage · extends an existing models3_signed_url_expiration (Signed URL Expiration (seconds)), s3_uses_signed_url_for_x_sendfile (Use signed URL for X-Accel-Redirect)
- ir.attachment · extends an existing model
Text generated by AI (DeepSeek) from reading the Odoo 19.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 4 confirmed, 5 with no information of 9 versions.
Sources · Odoo 19.0
Confirmed on 2026-11-03 in branch 19.0 of OCA/storage.
terminal Installation and usage
OCA documentation · Odoo 19.0Configuration
Source · Odoo 19.0On the Odoo instance, go to Settings > Technical > Storage > File Storage.
When you create a new storage for s3 or modify an existing one, when you activate the option "Use X-Sendfile To Serve Internal Url", 2 additional fields will appear:
- S3 Uses Signed URL For X-Accel-Redirect: If checked, the X-Accel-Redirect path will be a signed URL, which is useful for S3 storages that require signed URLs for access.
- S3 Signed URL Expiration: The expiration time for the signed URL in seconds. This field is only relevant if the previous option is checked. By default, it is set to 30 seconds but it could be less since the url generated into the X-Accel-Redirect process is directly used by the web server to serve the file.
The value of these fields can also be set in the server environment variables using the keys:
- s3_uses_signed_url_for_x_sendfile
- s3_signed_url_expiration
When the option "Use X-Sendfile To Serve Internal Url" is enabled, the system will generate an X-Accel-Redirect header in the response to a request to get a file. In the case of S3 storages, it will follow the format:
X-Accel-Redirect: /fs_x_sendfile/{scheme}/{host}/{path with query if any}Where:
{scheme}: The URL scheme (http or https).{host}: The host of the S3 storage.{path with query if any}: The path to the file in the S3 storage, including any query parameters. (Query parameters are set when thes3_uses_signed_url_for_x_sendfileoption is enabled.)
In order to serve files using X-Accel-Redirect, you must ensure that your web server is configured to handle these headers correctly. This typically involves setting up a location block in your web server configuration that matches the X-Accel-Redirect path and proxies the request to the S3 storage.
For example, if you are using Nginx, you would add a location block like this:
location ~ ^/fs_x_sendfile/(.*?)/(.*?)/(.*) {
internal;
set $url_scheme $1;
set $url_host $2;
set $url_path $3;
set $url $url_scheme://$url_host/$url_path;
proxy_pass $url$is_args$args;
proxy_set_header Host $url_host;
proxy_ssl_server_name on;
}Unlike the standard implementation of X-Accel-Redirect on non S3 storages, the S3 implementation does not require a base URL to be set in the storage configuration. The X-Accel-Redirect path is constructed directly from the S3 storage's URL defined for the connection, the directory name as bucket name, and the file path.
No verified information in OCA: Installation, Usage.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.