我正在使用 react native + Laravel API 构建一个移动应用程序。移动应用程序无需注册/登录即可由公众访问。
我想要的是,如何仅允许移动应用程序访问 API。API 不应允许来自网络。
我有设计页眉,页脚视频播放器视图等作为单独的文件。如何在每页中包含这些内容?
我尝试过这种方法。但不起作用。
我正在尝试将文件上传到 AWS S3 存储桶。这是我的表单和控制器
<form action="{{ url('/') }}" method="post" enctype="multipart/form-data">
{{ csrf_field() }}
<input type="file" name="image" id="image">
<button type="submit">Save</button>
</form>
Run Code Online (Sandbox Code Playgroud)
$file = $request->file('image');
$name = 'imgname.jpg';
$filePath = 'images/' . $name;
Storage::disk('s3')->put($filePath, file_get_contents($file));
Run Code Online (Sandbox Code Playgroud)
我还在 .env 文件中添加了 AWS 凭证。
Laravel 版本 6.0
我上传文件时出现以下错误。
GuzzleHttp\Exception\ConnectException cURL 错误 28:(参见http://curl.haxx.se/libcurl/c/libcurl-errors.html)