title: Python Dropbox - How to create a directory in Dropbox and Upload to that new folder?
body: <p>How can I use the Python Dropbox object to create a new folder under root and then populate that folder with data?</p>
  <p>How can I create a method in Python to send data into a specific folder within a Dropbox app? When I run the below code:</p>
  <pre><code>def ship_data_to_dbx(job_id, mn):
      # ship db and zip and txt to dir for the machine name in dropbox
      mn = mn.upper()
      # specific db path for the machine
      dbx_path = &quot;/&quot; + mn + &quot;/&quot;
      db_path = os.path.join(app.root_path, 'static/log_files', job_id + &quot;.db&quot;)
      with open(db_path, &quot;rb&quot;) as f:
          dbx.files_upload(f.read(), dbx_path, mute=True)
  </code></pre>
  <p>I get this error message:</p>
  <pre><code>dropbox.exceptions.ApiError: ApiError('8e663db4b9ae4d00b954f97065393160', UploadError('path', UploadWriteFailed(reason=WriteError('malformed_path', None), upload_session_id='AAAAAAAAAoBUOebujJCC_A')))
  </code></pre>
  <p>Thanks!</p>