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.
Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.