public function create_object($bucket, $object, $file, $opt = array())
{
$this->assertParameterArray($opt);
$opt[self::BUCKET] = $bucket;
$opt[self::OBJECT] = $object;
$opt['fileUpload'] = $file;
$opt[self::METHOD] = 'PUT';
if (isset($opt['acl'])) {
if (in_array($opt['acl'], self::$ACL_TYPES)) {
self::set_header_into_opt("x-bs-acl", $opt['acl'], $opt);
} else {
throw new BCS_Exception("Invalid acl string, it should be acl_type", -1);
}
unset($opt['acl']);
}
if (isset($opt['filename'])) {
self::set_header_into_opt("Content-Disposition", 'attachment; filename=' . $opt['filename'], $opt);
}
$response = $this->authenticate($opt);
//$this->log ( $response->isOK () ? "Create object[$object] file[$file] success!" : "Create object[$object] file[$file] failed! Response: [" . $response->body . "] Logid[" . $response->header ["x-bs-request-id"] . "]", $opt );
return $response;
}