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

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted

Dropbox API returning old images using dropboxClient.files.listFolder

Explorer | Level 3

I have an iOS app which uses SwiftyDropbox to show files in a folder in the dropbox account. Using "dropboxClient.files.listFolder", it always returns the files which have been deleted on the account and does not show the new files which have been added in the account i.e. showing always the same set of files. Could you please help me out on this.

 

5 Replies 5
Highlighted

Re: Dropbox API returning old images using dropboxClient.files.listFolder

Dropboxer
Dropboxer

@anuj-gola You only mentioned using listFolder, but you'll need to use listFolderContinue as well, in order to make sure you get all of the entries. Be sure to review the listFolder docs for more information on using these.

Highlighted

Re: Dropbox API returning old images using dropboxClient.files.listFolder

Explorer | Level 3

Thanks Greg for the quick reply, really appriciate it.

 

Let me iterate with an example here, suppose I have a folder named "Scenes" which has only 5 images. Now I load these all 5 images into my application using "listFolder" which works fine so far. Now I quit the application and remove 3 images in the "Scenes" folder and upload 2 more images into the same folder which now has 4 images in total. when I open my app and call the "listFolder" it returns me the old 5 images which it returned me for the first time. But if I log out the dropbox account using the SwiftyDropbox SDK and relogin, it returns me the updated 4 images in the "Scenes" folder.

 

Hope this clarifies the discrepancy here, please suggest.

 

Highlighted

Re: Dropbox API returning old images using dropboxClient.files.listFolder

Dropboxer
Dropboxer
To clarify, are you using listFolderContinue? You do need to make sure you have both listFolder and listFolderContinue implemented as documented to make sure you get the full/correct result.

If it's not working as expected, please share the actual code you're using and output you're getting. Thanks in advance!
Highlighted

Re: Dropbox API returning old images using dropboxClient.files.listFolder

Explorer | Level 3

I have not been using listFolderContinue as I have only lesss than 10 images in a folder. Do I need to use listFolderContinue if I have only 5 images in a folder?

 

Highlighted

Re: Dropbox API returning old images using dropboxClient.files.listFolder

Dropboxer
Dropboxer
While in most cases when dealing with so few files the code execution won't actually need to use listFolderContinue, that's not a guarantee. Certain cases can require multiple pages even for small numbers of files. That being the case, you do need to make sure you have listFolderContinue implemented as documented to make sure you get an accurate representation.
Polls
Do you know how to organize your files and folders?
We have created a guide on folder best practice, so you can get organized now check it out here.

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?