Creating a new directory and new file

To create a new file, you need to use the MKCOL to create a new collection.

This will create a new directory called testDir in the files collection. Make sure you include the full path right from the context.

Putting a new file in this directory just requires a PUT. The following putMethod will put a file called newFile.txt in the testDir directory, with content "test data".

To check whether the contents of the file were really stored, you can retrieve it using:

Getting the file to your local filesystem can be achieved with the following code:

-Luanne Coutinho

CreateNewDirectoryAndFile (last edited 2009-09-20 23:31:59 by localhost)