Added info on params option for upload()

This commit is contained in:
Devang Srivastava 2021-08-04 23:59:03 +05:30 committed by GitHub
parent 627ce8a867
commit 66b8d1f72a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -171,10 +171,11 @@ $my_space->uploadFile("path/to/my/file.txt", "path/on/space.txt", "private");
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3"); $my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Upload a local stored file. //Upload a local stored file.
$my_space->upload("my content", "path/on/space.txt", "private"); $my_space->upload("my content", "path/on/space.txt", "private", ["ContentType" => "text/plain"]);
``` ```
* The first argument (Content) can be a string, but it can also be a StreamInterface or PHP stream resource. * The first argument (Content) can be a string, but it can also be a StreamInterface or PHP stream resource.
* The third argument (File privacy) is optional. It defaults to private. * The third argument (File privacy) is optional. It defaults to private.
* The fourth argument (Params) is optional. You can find the options [here](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property).
* Returns available info on the file. * Returns available info on the file.