问题陈述:
我想知道在 Laravel 8 中是否可以将存储的文件从一个目录移动或复制到 AWS 中的另一个目录。我尝试了下面的代码,但它给了我以下错误。
/temp/file.pdf => /case/9/file.pdf
例外
Exception has occurred.
GuzzleHttp\Exception\ClientException:
Client error: `HEAD https://bucket-name.s3.us-east-2.amazonaws.com/case/9/file.pdf`
resulted in a `404 Not Found` response
Exception has occurred.
Aws\S3\Exception\S3Exception:
Error executing "HeadObject" on "https://bucket-name.s3.us-east-2.amazonaws.com/case/9/file.pdf";
AWS HTTP error: Client error: `HEAD https://bucket-name.s3.us-east-2.amazonaws.com/case/9/file.pdf` resulted in a `404 Not Found` response NotFound (client):
404 Not Found (Request-ID: ABCSDASLKAS) -
代码片段
下面的代码行将我抛出错误
Storage::disk('s3')->move(
"/temp/file.pdf",
"/case/9/file.pdf"
);
如果是,那么可以帮助做同样的事情吗?
快乐编码