title: Dropbox API v2 - uploading files
body: <p>I'm trying to loop through a folder structure in python and upload each file it finds to a specified folder. The problem is that it's uploading a file with the correct name, however there is no content and the file size is only 10 bytes. </p>
  
  <pre><code>import dropbox, sys, os
  try:
    dbx = dropbox.Dropbox('some_access_token')
    user = dbx.users_get_current_account()
  except:
    print ("Negative, Ghostrider")
    sys.exit()
  
  rootdir = os.getcwd()
  
  print ("Attempting to upload...")
  for subdir, dirs, files in os.walk(rootdir):
        for file in files:
          try:  
            dbx.files_upload("afolder",'/bfolder/' + file, mute=True)
            print("Uploaded " + file)
          except:
            print("Failed to upload " + file)
  print("Finished upload.")
  </code></pre>