I can now upload JPG ifrom my BackpackForLaravel to AWS 3 Yahhh!!!
我现在可以上传JPG ifrom我的BackpackForLaravel到AWS 3 Yahhh !!!
But how or where can i make change this code:
但是我如何或在哪里可以更改此代码:
$this->crud->addField([ // image
'label' => "Produkt foto",
'name' => "productfoto",
'type' => 'image',
'tab' => 'Produktfoto',
'upload' => true,
'crop' => true,
'aspect_ratio' => 1,
'disks' => 's3images' // This is not working ??
]);
To showing url from AWS S3 mith my uploaded JPG... (instead of local public)
要显示来自AWS S3的网址,我上传的JPG ...(而不是本地公开)
I can't find any documentation or code examples of it :-(
我找不到它的任何文档或代码示例:-(
Please help...
请帮忙...
1 个解决方案
#1
1
I don't really know how this can be of help to you. Pictures to S3 usually need to be base64 encoded so you will need to decode them before you can store in your s3 bucket. So how i handled it sometime ago is this:
我真的不知道这对你有什么帮助。 S3的图片通常需要进行base64编码,因此您需要先对它们进行解码才能存储到s3存储桶中。那我以前怎么处理它是这样的:
$getId = $request->get('myId');
$encoded_data = $request->get('myphotodata');
$binary_data = base64_decode($encoded_data);
$filename_path = md5(time().uniqid()).".jpg";
$directory = 'uploads';
Storage::disk('s3')->put($directory.'/'.$filename_path , $binary_data);
In summary, i am asuming you have the right permission on your bucket and ready to put in image from your storage disks.
总而言之,我认为您对存储桶拥有正确的权限,并准备从存储磁盘中放入映像。
#1
1
I don't really know how this can be of help to you. Pictures to S3 usually need to be base64 encoded so you will need to decode them before you can store in your s3 bucket. So how i handled it sometime ago is this:
我真的不知道这对你有什么帮助。 S3的图片通常需要进行base64编码,因此您需要先对它们进行解码才能存储到s3存储桶中。那我以前怎么处理它是这样的:
$getId = $request->get('myId');
$encoded_data = $request->get('myphotodata');
$binary_data = base64_decode($encoded_data);
$filename_path = md5(time().uniqid()).".jpg";
$directory = 'uploads';
Storage::disk('s3')->put($directory.'/'.$filename_path , $binary_data);
In summary, i am asuming you have the right permission on your bucket and ready to put in image from your storage disks.
总而言之,我认为您对存储桶拥有正确的权限,并准备从存储磁盘中放入映像。