为什么 october cms 不通过使用 amazon-s3 上传图像将附件保存在数据库中?
Why october cms don't save attachments on db by upload images with amazon-s3?
我对 AWS s3 和 October cms 有疑问。
如果我从媒体页面 s3 上传图像或文件工作正常,但如果我从对象(系统或小部件)上传图像是 attachment_id,并且 attachment_type 在 system_file table是空的。
所以,我无法按型号获取所有图像。
有人知道这是 10 月的 cms 错误还是我还有一些东西要配置?
filesystem.php 配置:
'default' => 's3',
'cloud' => 's3',
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
's3' => [
'driver' => 's3',
'key' => env('AWS3_KEY'),
'secret' => env('AWS3_SECRET'),
'region' => env('AWS3_REGION'),
'bucket' => env('AWS3_BUCKET'),
],
cms.php 配置:
'storage' => [
'uploads' => [
'disk' => 's3',
'folder' => 'chemie/uploaded-files',
'path' => 'https://amazon/s3/bucket-name/chemie',
],
'media' => [
'disk' => 's3',
'folder' => 'chemie',
'path' => 'https://amazon/s3/bucket-name/chemie',
],
],
sistem_file db table:
image
型号示例:
/**
* @var array
*/
public $attachMany = [
'gallery_images' => [
'System\Models\File',
],
];
实际上这是不可能的,因为 widget/file uploader
等与文件建立关系并将该关系保存在数据库中。
在媒体中,根据配置 local-disk
或 remote-disk
只是普通路径
So, if you want to add images which are stored on s3
you can add repeater field which have media widget in it to select files and upload files
in this way you can select or add multiple files.
从代码中我看到 remote-disk
在数据库 FileSystem
中没有可能的实现
Media uses remote disk
File-upload widget/Model uses only local disk
如有疑问请评论。
我对 AWS s3 和 October cms 有疑问。 如果我从媒体页面 s3 上传图像或文件工作正常,但如果我从对象(系统或小部件)上传图像是 attachment_id,并且 attachment_type 在 system_file table是空的。 所以,我无法按型号获取所有图像。
有人知道这是 10 月的 cms 错误还是我还有一些东西要配置?
filesystem.php 配置:
'default' => 's3',
'cloud' => 's3',
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
's3' => [
'driver' => 's3',
'key' => env('AWS3_KEY'),
'secret' => env('AWS3_SECRET'),
'region' => env('AWS3_REGION'),
'bucket' => env('AWS3_BUCKET'),
],
cms.php 配置:
'storage' => [
'uploads' => [
'disk' => 's3',
'folder' => 'chemie/uploaded-files',
'path' => 'https://amazon/s3/bucket-name/chemie',
],
'media' => [
'disk' => 's3',
'folder' => 'chemie',
'path' => 'https://amazon/s3/bucket-name/chemie',
],
],
sistem_file db table: image
型号示例:
/**
* @var array
*/
public $attachMany = [
'gallery_images' => [
'System\Models\File',
],
];
实际上这是不可能的,因为 widget/file uploader
等与文件建立关系并将该关系保存在数据库中。
在媒体中,根据配置 local-disk
或 remote-disk
只是普通路径
So, if you want to add images which are stored on
s3
you canadd repeater field which have media widget in it to select files and upload files
in this way you can select or add multiple files.
从代码中我看到 remote-disk
在数据库 FileSystem
Media uses remote disk
File-upload widget/Model uses only local disk
如有疑问请评论。