mirror of
https://github.com/SociallyDev/Spaces-API.git
synced 2025-07-07 13:31:31 -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.
|
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)) {
|
if(empty($save_as)) {
|
||||||
$save_as = $pathToFile;
|
$save_as = $pathToFile;
|
||||||
}
|
}
|
||||||
|
@ -266,10 +266,11 @@ class SpacesConnect {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$result = $this->client->putObject(array(
|
$result = $this->client->putObject(array(
|
||||||
'Bucket' => $this->space,
|
'Bucket' => $this->space,
|
||||||
'Key' => $save_as,
|
'Key' => $save_as,
|
||||||
'Body' => $file,
|
'Body' => $file,
|
||||||
"ACL" => $access
|
'ACL' => $access,
|
||||||
|
'ContentType' => $mime_type
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->client->waitUntil('ObjectExists', array(
|
$this->client->waitUntil('ObjectExists', array(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue