Closed abazeed closed 2 years ago
Is there any way to store them in subfolders
/yyyy/mm/dd/
automatically
This is a WordPress setting; see Settings > Media > Organize my uploads into month- and year-based folders
and without the parent
/uploads/
folder
This can be achieved by filtering the upload directory after S3 Uploads has taken place.
Please also note our support policy :)
This is a WordPress setting; see Settings > Media > Organize my uploads into month- and year-based folders
This will not add a day subfolder, it's only YYYY/MM
, not YYYY/MM/DD
.
I was able to resolve this using this hook s3_uploads_putObject_params
of your plugin, like this:
function filter_s3_upload_path( array $params ): array {
$params['Key'] = date('Y/m/d/') . basename( $params['Key'] );
return $params;
}
add_filter( 's3_uploads_putObject_params', 'filter_s3_upload_path');
Currently, all the uploaded images are stored directly in
/uploads/
folder on the S3 bucket. Is there any way to store them in subfolders/yyyy/mm/dd/
automatically, and without the parent/uploads/
folder?