2

My app uses the realtime api to store most of the data in a document. The Drive UI gives users the option of making a copy of the files my app created, but the copies do not include copies of the realtime documents associated with the files! Aiee!

Is there a way around this besides constantly syncing my realtime documents with the file bodies themselves? My documents will be megabytes large, so uploading them as file bodies frequently would be prohibitive.

Riley Lark
  • 20,660
  • 15
  • 80
  • 128

1 Answers1

2

My understanding is that the real time model is not copied when the mimetype of the file is anything but the shortcut type:

application/vnd.google-apps.drive-sdk

If you use any mimetype other than that it's assumed you're storing the file contents as well as the real time model, so when a copy operation is performed, only a copy of the file contents are made, not the RT model. If you're not using a realtime shortcut type, it's expected that you have a normal Drive file with content and just that content is copied over. When you load that file into your application, you should see that the RT model is empty and apply the content, if there is any.

This is what the Drive team told me. Thinking about it, I guess the idea is to not copy the history of the file over to the new one, just the raw content.

Frodo Baggins
  • 8,290
  • 6
  • 45
  • 55
  • Ahh, that makes sense. I want a little bit of both kinds of functionality - maybe I'll see if I can stay within the 10 MB realtime limit and go with shortcut files. Thanks! – Riley Lark Nov 26 '13 at 14:08
  • From what I've observed the Drive UI doesn't let you make copies of shortcut files at all --- the UI simply doesn't show up most of the time, and if you really force it, you end up with two directory entires both pointing at the same backend storage. – David Given Mar 07 '16 at 21:43