To publish a file for a specific period, use the publishBodyExpires(in:_:) method as shown in the following sample code. This code publishes a file for one hour from now. Specify a period in seconds.
The basic steps are as follows:
Upload the file as an object body.
Publish the file with the publishBodyExpires(in:_:) method.
Note that a user needs to be permitted the KiiACLObjectActionRead action on a KiiObject to publish its object body (Once published, anyone can access the object body with the URL). See Setting a KiiObject's ACL for more information about the access rights.