IPWorks Cloud 2020 C++ Edition

Questions / Feedback?

PutBlock Method

Uploads a new block of data to a block blob.

Syntax

ANSI (Cross Platform)
char* PutBlock(const char* lpszBlockBlob, const char* lpszBlockId);

Unicode (Windows)
LPWSTR PutBlock(LPCWSTR lpszBlockBlob, LPCWSTR lpszBlockId);
- (NSString*)putBlock:(NSString*)blockBlob :(NSString*)blockId;
#define MID_AZUREBLOB_PUTBLOCK 27

IPWORKSCLOUD_EXTERNAL int IPWORKSCLOUD_CALL IPWorksCloud_AzureBlob_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

This method uploads a new block of data with the given BlockId to the specified BlockBlob in the container currently selected by Container. The block of data is uploaded in an uncommitted state; it will not be available as part of the block blob until it is committed in a PutBlockList operation.

The Base64-encoded Id of the block is returned (if the EncodeBlockIds configuration setting is disabled, the same value as passed for BlockId is returned; see below for more information).

If the specified BlockBlob does not yet exist, it is created in an uncommitted state. If an uncommitted block with the specified BlockId is already associated with the specified BlockBlob, it is replaced.

Block Ids must be Base64-encoded when sent to the server. By default, the class will automatically Base64-encode block Ids as they are sent, and Base64-decode them as they are received. This behavior can be configured using the EncodeBlockIds configuration setting.

All block Ids must be less than or equal to 64 bytes in length before being Base64-encoded. Additionally, all blocks Ids within a single block blob must be unique, and of the exact same length after Base64-encoding.

Up to 100MB (104857600 bytes) of data may be uploaded in a single block, and up to 100000 uncommitted blocks may be associated with a block blob at any time.

If the block is successfully uploaded, the class will automatically call AddBlock to add an item to the Block* properties. This behavior can be changed using the AutoAddBlocks configuration setting.

If BlockBlob already exists and has an active lease, its lease Id must be specified using LeaseId, or the request will fail.

Error Handling (C++)

This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 C++ Edition - Version 20.0 [Build 8265]