The JS object model lacks a way to move files from one FileBase to another with all file stats
As of the 3.19b release of Synchronet, there is a new FileBase class but the JavaScript object model currently lacks a mechanism to move a file from one FileBase to another while preserving all file stats (for example, the file would not retain its last_downloaded, times_downloaded, and other stats).
Currently, the only way to move a file from one FileBase to another is as follows:
- Get the file's metadata object using FileBase.get(filename, FileBase.DETAIL.EXTENDED)
- Remove the file from the FileBase using FileBase.remove(filename, false)
- Move the file to the other filebase directory (using file_rename()), open that filebase, and use FileBase.Add(meta-data object)
The metadata object retrieved in step 1 does not include stats such as number of times downloaded, last downloaded, etc., and that information would be lost when moving a file to another filebase.