Unfortunately Dropbox doesn't offer an interface for programmatically managing this setting, such as to set a file to "online" or "offline", but I'll pass this along as a feature request. I can't promise if or when that might be offered though.
You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.