mirror of
https://github.com/SociallyDev/Spaces-API.git
synced 2025-07-06 04:51:32 -07:00
Support content type for UploadFile().
This commit is contained in:
parent
6301cb1adb
commit
0addc2cf7b
1 changed files with 6 additions and 5 deletions
11
spaces.php
11
spaces.php
|
@ -252,7 +252,7 @@ class SpacesConnect {
|
|||
/*
|
||||
Upload a file.
|
||||
*/
|
||||
function UploadFile($pathToFile, $access = "private", $save_as = "") {
|
||||
function UploadFile($pathToFile, $access = "private", $save_as = "", $mime_type = "application/octet-stream") {
|
||||
if(empty($save_as)) {
|
||||
$save_as = $pathToFile;
|
||||
}
|
||||
|
@ -266,10 +266,11 @@ class SpacesConnect {
|
|||
}
|
||||
try {
|
||||
$result = $this->client->putObject(array(
|
||||
'Bucket' => $this->space,
|
||||
'Key' => $save_as,
|
||||
'Body' => $file,
|
||||
"ACL" => $access
|
||||
'Bucket' => $this->space,
|
||||
'Key' => $save_as,
|
||||
'Body' => $file,
|
||||
'ACL' => $access,
|
||||
'ContentType' => $mime_type
|
||||
));
|
||||
|
||||
$this->client->waitUntil('ObjectExists', array(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue