Upload Method
Uploads the file specified by LocalFile to the server.
Syntax
ANSI (Cross Platform) int Upload(); Unicode (Windows) INT Upload();
- (void)upload;
#define MID_CLOUDSTORAGE_UPLOAD 13 IPWORKSCLOUD_EXTERNAL int IPWORKSCLOUD_CALL IPWorksCloud_CloudStorage_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);
Remarks
This method uploads the local file specified by LocalFile to the remote file specified by RemoteFile. If SetUploadStream is used to set an upload stream the data to upload is taken from the stream instead.
RemoteFile should be set to either a relative or absolute path. If RemoteFile is not an absolute path it will be uploaded relative to RemotePath.
To encrypt a file before uploading set EncryptionAlgorithm and EncryptionPassword.
Note: Resuming uploads is not currently supported.
Code Example:
//Upload with a relative path cloudstorage.LocalFile = "C:\localfile.txt" cloudstorage.RemoteFile = "remotefile.txt" cloudstorage.Upload() //Upload with an absolute path cloudstorage.LocalFile = "C:\localfile2.txt" cloudstorage.RemoteFile = "/folder/remotefile2.txt" cloudstorage.Upload()
Error Handling (C++)
This method returns a 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. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)