SetUploadStream Method

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

Syntax

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

Unicode (Windows)
INT SetUploadStream(IPWorksSSHStream* sUploadStream);
#define MID_SCP_SETUPLOADSTREAM 13

IPWORKSSSH_EXTERNAL int IPWORKSSSH_CALL IPWorksSSH_SCP_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

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.

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) 2023 /n software inc. - All rights reserved.
IPWorks SSH 2020 C++ Edition - Version 20.0 [Build 8501]