SetUploadStream Method

Sets the stream from which the class will read data to upload to the server.

Syntax

ANSI (Cross Platform)
int SetUploadStream(IPWorksStream* sUploadStream);

Unicode (Windows)
INT SetUploadStream(IPWorksStream* sUploadStream);
#define MID_FTP_SETUPLOADSTREAM 18

IPWORKS_EXTERNAL int IPWORKS_CALL IPWorks_FTP_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

This method is used to set the stream from which the class will read data to upload to the server. If an upload stream is set before the Upload method is called, the content of the stream will be read by the class and uploaded to the server. The stream should be open and normally set to position 0. The class will automatically close this stream if CloseStreamAfterTransfer is true (default). If the stream is closed, you will need to call SetUploadStream again before calling Upload again. The content of the stream will be read from the current position all the way to the end and no bytes will be skipped even if StartByte is set to a non zero value (though the server will be instructed to skip those bytes in its file).

Note: SetUploadStream and LocalFile will reset the other.

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.)

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