IPWorks Cloud 2020 C++ Edition

Questions / Feedback?

UploadFile Method

Uploads a file.

Syntax

ANSI (Cross Platform)
char* UploadFile(const char* lpszNewFilePath);

Unicode (Windows)
LPWSTR UploadFile(LPCWSTR lpszNewFilePath);
- (NSString*)uploadFile:(NSString*)newFilePath;
#define MID_HADOOPDFS_UPLOADFILE 23

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

Remarks

This method uploads a new file to NewFilePath and returns the full path of the uploaded file. If a file already exists on the server at NewFilePath, the Overwrite property controls whether the server will overwrite the file or return an error.

If the CreatePermission configuration setting is non-empty, the file will be created with the permission it specifies. Otherwise, the server's default (755) will be used.

If SetUploadStream has been used to set an upload stream, it will take priority as the file data source. If LocalFile is set the file will be uploaded from the specified path. If LocalFile is not set the data in ResourceData will be used.

To encrypt the file before uploading it, set EncryptionAlgorithm and EncryptionPassword.

hdfs.LocalFile = "../MyFile.zip";
hdfs.UploadFile("/MyFile.zip");

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]