Sending Files to a Client Using OFTPServer


OFTPServer allows sending files from memory instead of disk, which is useful when data is generated dynamically.

To send a file from a stream, assign the stream to UploadStream on the connection and call SendFile with an empty file path. The component will use the stream as the file content.

server.Connections[connId].UploadStream = ms;
server.SendFile(connId, client.ClientSFIDCode, "", "test1.txt");

We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.