This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Storage; | |
class UploadController extends Controller | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"file" : " data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAADlCAMAAAAP8WnWAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAACr1BMVEUAAAD/LiD/LSD/LSD/LSD/LB//LR7/MR3/LSD/LSD/LSD/LiD/QAD/Kyv/LSD/LSD/LR//LiH/LSD/Lh//LB3/KyD/LSD/LSD/LiD/JCT/KBv/LSD/LB//VQD/MzP/LSD/LSD/LiH/LCL/LSD/LR//LSD/LCD/LCP/LyL/LSH/LSD/LiH/AAD/LSD/LSD/LSD/Kyv/Jyf/LiH/AAD/LSD/Lh//LSL/LSD/LSD/LR//Kx//LSD/Lh//KyD/KyP/LSD/LSD/LSD/LiD/ICD/Lhf/LSD/MyL/Lx//LSD/LSD/LSD/LR//LB//LiD/LCH/LyH/LSD/LR//LiP/Lxz/LSD/LSD/LSD/Mxr/LR//LR//MST/LCL/LiH/LSD/LSH/LSL/LSH/LSD/Lx7/Lh//LSD/LCD/MCD/KR//JCT/LiT/LSD/LCH/LSD/LiD/LSD/LyD/LSD/LSD/LSD/LR7/LSH/LCH/Kxz/LCD/LSH/ORz/LCH/LCD/KSH/LR//LSD/LB//LB//LiD/LCD/LiH/LSH/LyL/LiD/LSD/LiD/KyL/KyL/LSD/LSD/LSD/LSD/MCL/LiD/LCH/Lh7/LSD/Myb/LSD/LSH/LSD/LSD/LSH/LCH/LSD/KyH/LCD/LiD/LSD/LR//LiD/LR//LB//LSD/LiD/LiP/LR7/LB//LSH/LCH/Lh//LSD/LSD/LSD/LCD/LSD/LiD/LSD/LR//Lh//LR//LSD/LiD/LB//LSD/LB//LSD/Lh//LCD/LR//LCD/LiH/LSD/LB//LSD/LSD/LR//LSD/MCD/LSD/LCH/Kx7/LB//LCH/LCD/LSD/Lh//LSD/LiH/LiH/LR//LSD/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Storage; | |
class UploadController extends Controller | |
{ | |
/** | |
* sendFile: Método responsável por enviar o arquivo no formato base64 | |
*/ | |
public function sendFile(Request $request) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Storage; | |
class UploadController extends Controller | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php artisan storage:link |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/paulodutra/upload-base64-laravel6.git | |
mv upload-base64-laravel6 salvando-arquivos-aws-s3-laravel-6 | |
composer install | |
cp .env.example .env | |
php artisan key:generate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"aws/aws-sdk-php": "3.0", | |
"league/flysystem-aws-s3-v3": "~1.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILESYSTEM_DRIVER=s3 | |
AWS_ACCESS_KEY_ID='sua-key' | |
AWS_SECRET_ACCESS_KEY='sua-access-key' | |
AWS_DEFAULT_REGION=us-west-2 | |
AWS_BUCKET=aws-s3-files | |
AWS_URL="https://s3.us-west-2.amazonaws.com/aws-s3-files" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AddPerm", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::nome-do-bucket/*" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install -g docusaurus-init |