The CreateFile method uses the PUT command to create the
file. The server must support this command and the user must have
the appropriate permission to create the specified file. If this
method is successful, the client should then use the Write
method to send the contents of the file to the server. Once all of
the data has been written, the CloseFile method should be
called to close the file and complete the operation. Note that this
method is typically only accepted by servers that support version
1.1 of the protocol or later.
When using Write to send the contents of the file to the
server, it is recommended that the data be written in logical blocks
that are no larger than 8,192 bytes in size. Attempting to write very
large amounts of data in a single call can either cause the thread to
block or, in the case of an asynchronous connection, return an error
if the internal buffers cannot accommodate all of the data. To send
the entire contents of a file at once, use the PutData method
instead of calling CreateFile.