The documentation here seems to be incomplete. There is no explanation of the appropriateFor property that is being passed in the example.
I do not understand the relevance of a desktop URL being passed in this example to create a temporary directory.
Example code I have found seem to always pass 'nil' to this property.