Get a list of who uploaded each Dropbox file in a folder

dropbox

In the web interface, I can ask to see the "previous versions" and that listing tells who uploaded the file from what machine, for each version (in the last 30 days).

But that is extremely cumbersome to do for a large collection of files. What would be useful is a way to obtain the information in a single list or spreadsheet, for all the current files. If previous versions are also included, I'm OK with that too, but current version information is really what I am after.

Best Answer

Here's a python program to print the info. Other representations of the data could be created instead.

# Include the Dropbox SDK
import dropbox
import pprint

# Get your app key and secret from the Dropbox developer website
app_key = '...'
app_secret = '...'

flow = dropbox.client.DropboxOAuth2FlowNoRedirect( app_key, app_secret )

# Have the user sign in and authorize this token
# authorize_url = flow.start()
# print('1. Go to: ' + authorize_url )
# print('2. Click "Allow" (you might have to log in first)')
# print('3. Copy the authorization code.')
# code = input("Enter the authorization code here: ").strip()

# This will fail if the user enters an invalid authorization code
# access_token, user_id = flow.finish( code )

user_id = '...'
access_token='...'

client = dropbox.client.DropboxClient(access_token)
print('linked account:')
pprint.pprint( client.account_info())

todo = ['/spw']
while( todo ):
    iz = todo.pop()
    folder_metadata = client.metadata( iz )
    for iy in folder_metadata['contents']:
        if iy['is_dir']:
            todo.append( iy['path'])
        else:
            dnam = iy['modifier']['display_name']
            print( iy['path'], dnam )