Cut the Clutter: Test Ignore Files Feature - sign up to become a beta tester here.

Forum Discussion

Gregg W.1's avatar
Gregg W.1
Helpful | Level 5
3 years ago

How to programmatically make files available offline.

I have a Macintosh app that does not use the Dropbox api - however, my users do save the app’s data files & packages in a Dropbox folder.

 

The problem is that recently users have been having file packages saved as “Available online-only” which causes huge and unexpected problems and the solution is to switch the file to “available offline.”

 

My question is: Rather than walking my users through the Finder to switch the file package to “available offline” is there something I can do in my app (perhaps via NSFileManager) to change the file to “available offline.”

 

Thanks for your thoughts on this.

9 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    3 years ago

    No, unfortunately Dropbox doesn't offer an interface for programmatically managing this setting, such as to set a file to "offline", but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.

  • Gregg W.1's avatar
    Gregg W.1
    Helpful | Level 5
    3 years ago

    Thanks for the prompt reply, even though it's not what I was hoping for.

     

    I thought a customer of mine had reported double-clicking on a 'Zero byte' png file and the file downloaded from the Dropbox cloud and opened in Apple's Preview app.

     

    If that's true, what is Apple's Preview app doing to trigger the download that I am not doing?

     

    If it's not true, then I apologize for the diversion. I'm still getting a handle on how to deal with the 'Zero byte' files.

     

    Gregg

  • Rich's avatar
    Rich
    Icon for Super User II rankSuper User II
    3 years ago

    Gregg W.1 wrote:

    I thought a customer of mine had reported double-clicking on a 'Zero byte' png file and the file downloaded from the Dropbox cloud and opened in Apple's Preview app.


    That's how the feature used to work. If you tried to open an online-only file, the file would be downloaded to the computer and marked as Local. It would remain local until it was manually marked as Online-only again.

     

    Ever since the change, the feature (formally called Smart Sync) now has three states; Available Offline, Available and Online-only. From what I've seen on the forums, Macs have had issues with files switching to Local or Available on the fly, and many have had to manually mark a file as Available Offline before they open it. Search the forums for those topics as other Dropboxers have commented and possibly provided solutions or work-arounds. I'm not a Mac user so I can't comment beyond that.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    3 years ago

    Gregg W.1 That would be a matter of the Dropbox desktop client, but I can only really help with the Dropbox API itself, so I'm afraid I can't offer insight on that. You may want to contact support for help regarding the desktop client behavior. Apologies I can't be of more help in that regard!

  • Gregg W.1's avatar
    Gregg W.1
    Helpful | Level 5
    3 years ago

    Thanks for the reply Rich.

     

    That sounds like what my users are seeing - seemingly random files switching to online-only and dropping in size to zero bytes.

     

    It does seem that the last modified date is being considered when deciding what files are getting moved to the cloud. That is, older files are being moved to the cloud and set to zero bytes. The trouble is that these older files are actually cache files that are being used on a daily basis.

     

    I will search for other threads as you suggested.

     

    Thanks.

     

    Gregg

  • boeboe's avatar
    boeboe
    New member | Level 2
    2 years ago

    Some problem here. 
    I would also appreciate a programmatic solution. Why is the API not given equal importance?
    Both agents (API + desktop synchronization) should be able to override each others settings, the latest setting should win.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    2 years ago

    boeboe I don't have an update on this feature request, but thanks for the feedback!

  • bob-is-not-my-uncle's avatar
    bob-is-not-my-uncle
    New member | Level 1
    8 months ago

    It's been three years since the original request and two years since the last update. I know Dropbox has been working on a lot of workflowy things since. Any update on how to do this? It seems like I should be able to make a service call to a local app API using a RESTful call that passes the filename and location relative to the Dropbox root folder and set the desired state of the file as either 0 = Online-only, 1 = Available Offline. Additionally if I pass the filename and path, but no state it stands to reason I should be able to check the state to see if a file is in state 2 = Available.

    We should also be required to pass a token as part of the request for authentication to prevent rouge requests, floods, DDoS, etc.

    Any updates?

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers815 PostsLatest Activity: 4 years ago
280 Following

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!