Overwrite a file with Dropbox API v2 in Python
<p>I'm trying to overwrite a file on Dropbox with Python 3.4 but can't figure out how to do it.  If the file doesn't exist, <code>dbx.files_upload(data, '/file.py')</code> creates the file as expected.</p>

<p>But if the file exists, I want to overwrite it.  I've tried</p>

<pre><code>dbx.files_upload(data, '/file.py', mode=WriteMode('overwrite'))
</code></pre>

<p>which gives</p>

<pre><code>NameError: name 'WriteMode' is not defined
</code></pre>

<p>and I've tried</p>

<pre><code>dbx.files_upload(data, '/iot_main.py', overwrite=True)
</code></pre>

<p>which gives</p>

<pre><code>TypeError: files_upload() got an unexpected keyword argument 'overwrite'
</code></pre>

<p>I feel as if I'm missing something obvious but lots of Googling for an answer doesn't help...</p>

<p>Thanks.</p>