Back to product page

ServeFile method


Serves file through integrated web server.

Type

A XMPPFile object.

Syntax

  • Basic
object.ServeFile (Filename, MaxConn)
The ServeFile(object,Filename,MaxConn) syntax has these parts:
objectAn expression evaluating to an object of type wodXMPP
FilenameA String value. Full path to the file that will be sent.
MaxConnA Long value. Defines maximum number of connections to accept.

Remarks

ServeFile method will open up internal web server to serve your file to other contacts. It is used internally for sending files if remote contact doesn't support file transfers, but prefers to get file using provided URL. ServeFile method will create this URL and start serving the file, allowing up to MaxConn total number of connections. When total number of connections has been made, file will be removed from the collection.

You can provide URL of returned file to other contacts, just provide them with correct DataIP address and port (stored in DataPort). You can provide any IP of your computer, since ServeFile will bind all adapters.

Return value of ServeFile method is newly created XMPPFile object, where you can set up other properties, or access them if needed, at later time.

If you want to provide unlimited number of connections in MaxConn argument, set it to -1.

Platforms

Windows