
SendFile method
Sends file to remote peer.
Type
Integer.Syntax
- C#
- C++
- VB.NET
int devP2P.SendFile(IntPtr Handle, int chanid, string localfilename, string remotefilename, bool doresume);
The SendFile(Handle,chanid,localfilename,remotefilename,doresume) syntax has these parts:
The SendFile(Handle,chanid,localfilename,remotefilename,doresume) syntax has these parts:
Handle | Reference to the devP2P instance. |
chanid | Integer that specifies channel index. |
localfilename | Full path to local file. |
remotefilename | Path where to save file on remote. |
doresume | Determines if file transfer should be resumed from previous position. |
Return value | 0 (ErrorNone) if success, otherwise negative value from Errors enumeration. |
int SendFile(int chanid, char *local_filename, char *remote_filename = 0, bool resume = false);
The SendFile(chanid,local_filename,remote_filename,resume) syntax has these parts:
The SendFile(chanid,local_filename,remote_filename,resume) syntax has these parts:
chanid | Integer that specifies channel index. |
local_filename | Full path to local file. |
remote_filename | Path where to save file on remote. |
resume | Determines if file transfer should be resumed from previous position. |
Return value | 0 (ErrorNone) if success, otherwise negative value from Errors enumeration. |
Function P2P_SendFile(ByVal Handle As IntPtr, ByVal chanid As Integer, ByVal localfilename As String, ByVal remotefilename As String, ByVal doresume As Boolean) As Integer
The SendFile(Handle,chanid,localfilename,remotefilename,doresume) syntax has these parts:
The SendFile(Handle,chanid,localfilename,remotefilename,doresume) syntax has these parts:
Handle | Reference to the devP2P instance. |
chanid | Integer that specifies channel index. |
localfilename | Full path to local file. |
remotefilename | Path where to save file on remote. |
doresume | Determines if file transfer should be resumed from previous position. |
Return value | 0 (ErrorNone) if success, otherwise negative value from Errors enumeration. |
Remarks
This method will initiate sending file to remote peer. Remote side will receive FileSend event (to decide if it wants to accept the file), then one or more FileProgress events, and finally FileDone when transfer finishes.You should use one of available 1024 channels to send this file, just make sure this channel isn't already busy with transferring other file, or channel forwarding.
Platforms
WindowsMac OSX
Linux
BSD