2
Error executing "ListObjects" on " https://s3.your-region.amazonaws.com/your-bucket?prefix=abc%2F1468895496.jpg%2F&max-keys=1&encoding-type=url "; AWS HTTP error: cURL error 6: Could not resolve host: s3.your-region.amazonaws.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)Laravel AWS S3上传图片错误(地区错误?)
<?php
namespace App\Http\Controllers;
use Illuminate\Contracts\Filesystem\Filesystem;
use App\Product;
use Illuminate\Http\Request;
class ProductController extends Controller
{
...
public function store(Request $request)
{
$image = $request->file('file');
$imageFileName = time() . '.' . $image->getClientOriginalExtension();
$s3 = \Storage::disk('s3');
$filePath = '/abc/' . $imageFileName;
$s3->put($filePath, file_get_contents($image), 'public');
return redirect()->action('[email protected]');
}
相关:http://stackoverflow.com/questions/34588066/laravel-5-1-seems-not-to-be-adding-config-values-to-s3-upload/34599133 – pah