The Central Server Service allows users to share files.
Central Server Service configuration
To enable sharing files through the Central Server,
setup the FileTransferPort and FileTransferDirectory config keys in teh Central Server Service configuration file.
The following configuration uses port 17865 to transfer files, and files will be stored in C:\TEMP where the Central Server Service is running from.
<add key="FileTransferPort" value="17865" />
<add key="FileTransferDirectory" value="C:\TEMP" />
Sharing a file with a user
To Share a file with a user, call the ShareFile function
string fileId = icserver.ShareFile(@"C:\filetoshare.txt);icserver.SendShareFileRequest(fileId, "user2");
The user 'user2' will then receive a
public delegate void ProcessFileShareRequestDelegate( string fileId, string fromuser, string filename, long fileSize); private void ProcessFileShareRequest(string fileId, string fromuser, string filename, long fileSize) { string message = string.Empty; message = fromuser + " is sharing a file with you\n\n"; message += " Filename : " + filename + "\n"; message += "Size : " + fileSize + "\n\n"; message += "Would you like to accept ?\n"; if (MessageBox.Show(message, @"File sharing request", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ics.GetFile(fileId, filename, @"C:\receivedfile.txt"); } } private void ics_NewFileShareRequest(string fileId, string fromuser, string filename, long fileSize) { Invoke(new ProcessFileShareRequestDelegate(ProcessFileShareRequest), new object[] { fileId, fromuser, filename, fileSize }); }
When the file download completes, the iConfServerDotNet.FileDownloadCompleted Event is fired.
To monitor the progress of a file download, use the iConfServerDotNet.FileDownloadProgress Event
Doc-O-Matic.|
What do you think about this topic? Send feedback!
|
|
Copyright (c) 2009. AVSPEED, Inc. All rights reserved.
|