检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
// require 'obs-autoloader.php'; // Declare the namespace. use Obs\ObsClient; // Create an instance of ObsClient. $obsClient = new ObsClient ( [ //Obtain an AK/SK pair using environment variables or import the AK/SK pair in other ways.
The network connection to the OBS server breaks often. The size of a file to be uploaded is unknown.
For example, if the path of an object in the bucket is obs://bucket/src1/src2/test.txt, then the absolute path of the object is src1/src2/test.txt. This matching pattern applies only to objects whose names do not end with a slash (/).
Parameter Description Method in OBS iOS SDK bucketName (Mandatory) Bucket name request.bucketName objectKey (Mandatory) Object name request.objectKey objectACLPolicy Object access control policy request.objectACLPolicy storageClass Object storage class request.storageClass metaDataDict
Parameter Description Property in OBS .NET SDK BucketName (Mandatory) Bucket name UploadFileRequest.BucketName ObjectKey (Mandatory) Object name UploadFileRequest.ObjectKey UploadFile (Mandatory) Path to the local file to be uploaded UploadFileRequest.UploadFile UploadPartSize Part
Parameter Description Property in OBS .NET SDK BucketName (Mandatory) Bucket name DownloadFileRequest.BucketName ObjectKey (Mandatory) Object name DownloadFileRequest.ObjectKey DownloadFile Full path of the local directory to which the object is downloaded.
// require 'obs-autoloader.php'; // Declare the namespace. use Obs\ObsClient; // Create an instance of ObsClient. $obsClient = new ObsClient ( [ //Obtain an AK/SK pair using environment variables or import the AK/SK pair in other ways.
the READ permission to all users. acl.grantPermission(GroupGrantee.ALL_USERS, Permission.PERMISSION_READ); obsClient.setObjectAcl("bucketname", "objectname", acl); The owner or grantee ID needed in the ACL indicates the account ID, which can be viewed on the My Credentials page of OBS
You can set the following conditions: Parameter Description Method in OBS Android SDK Copy-Source-If-Modified-Since Copies the source object if it has been modified since the specified time; otherwise, an exception is thrown.
You can host static website resources such as HTML web pages, flash files, or audio and video files in an OBS bucket, so that you can provide these hosted resources using the bucket's website endpoint to end users.
String ak = System.getenv("ACCESS_KEY_ID"); String sk = System.getenv("SECRET_ACCESS_KEY_ID"); // (Optional) If you are using a temporary AK/SK pair and a security token to access OBS, you are advised not to use hard coding, which may result in information leakage.
accessControlPolicy:policy]; [client setObjectACL:request completionHandler:^(OBSSetObjectACLResponse *response, NSError *error){ NSLog(@"%@",response); }]; The owner or grantee ID needed in the ACL indicates the account ID, which can be viewed on the My Credentials page of OBS
You can set the following conditions: Parameter Description Enumeration Value in OBS iOS SDK Copy-Source-if-Match Copies the source object if its ETag is the same as the one specified by this parameter; otherwise, an exception is thrown. cpSrcIfETagMatch Copy-Source-if-None-Match
response.StatusCode); } catch (ObsException ex) { Console.WriteLine("ErrorCode: {0}", ex.ErrorCode); Console.WriteLine("ErrorMessage: {0}", ex.ErrorMessage); } The owner or grantee ID needed in the ACL indicates the account ID, which can be viewed on the My Credentials page of OBS
You can set the following conditions: Parameter Description Property in OBS .NET SDK Copy-Source-If-Modified-Since Copies the source object if it has been modified since the specified time; otherwise, an exception is thrown.
Sample code: // Import the OBS library. var ObsClient = require('./lib/obs'); // Create an instance of ObsClient. var obsClient = new ObsClient({ // Hard-coded or plaintext AK/SK are risky.
String ak = System.getenv("ACCESS_KEY_ID"); String sk = System.getenv("SECRET_ACCESS_KEY_ID"); // (Optional) If you are using a temporary AK/SK pair and a security token to access OBS, you are advised not to use hard coding, which may result in information leakage.
You can perform the following to implement website file hosting: Upload a website file to your bucket in OBS as an object and set the MIME type for the object. Set the object ACL to public read. Access the object using a browser.
Parameter Description Property in OBS .NET SDK BucketName Bucket name ListObjectsRequest.BucketName Prefix Name prefix that the objects to be listed must contain ListObjectsRequest.Prefix Marker Object name to start with when listing objects in a bucket.
Method void (*temp_auth_callback)(char *temp_auth_url, uint64_t temp_auth_url_len, char *temp_auth_headers, uint64_t temp_auth_headers_len, void *callback_data); To access OBS using a temporary URL generated by the OBS SDK for C, perform the following steps: Call any interface