cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Overwrite a File

New member | Level 2
New member | Level 2

Folks;

I'm brand new and just assessing the API but have this question:

I see that Dropbox API does not directly support appending text to an existing file.

If I want to accomplish that task it would seem that I would 1) download the original file; 2)extract the contents; 3) append my new content to this extraction; 4) write this new combined content back to a new file; 5)upload to dropbox with the same name as the existing original file...   

Thanks for any insights!

Steve

Will this strategy work in the v2API as it stands today?  Can anyone provide a link to the most relevant API calls?

1 Accepted Solution

Accepted Solutions
Highlighted

Re: Overwrite a File

Dropboxer
Dropboxer

Yes, the API unfortunately doesn't offer a way to append directly (I'll send this along as a feature request though), so you'd need to download and upload the edited content.

First, to download the existing file, you would use /2/files/download.

After you make your modifications locally, you would then upload the new version using /2/files/upload.

Those are links to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible. Those have corresponding native methods for the HTTPS endpoints. 

View solution in original post

2 Replies 2
Highlighted

Re: Overwrite a File

Dropboxer
Dropboxer

Yes, the API unfortunately doesn't offer a way to append directly (I'll send this along as a feature request though), so you'd need to download and upload the edited content.

First, to download the existing file, you would use /2/files/download.

After you make your modifications locally, you would then upload the new version using /2/files/upload.

Those are links to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible. Those have corresponding native methods for the HTTPS endpoints. 

View solution in original post

Highlighted

Re: Overwrite a File

New member | Level 2
New member | Level 2

Greg K

Perfect!  Thank-You.

Timely, on-point and answering all aspects of the question.

Sweet!

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?