Back

[SOLVED] listFiles returns only 25 files

  • 1
  • Web
  • Storage
Mr.ppDulce
3 Aug, 2023, 11:54

Hello I’m using the web client sdk to get a list of all my files in a specific bucket, I get 27 as the total but 25 files in the response am I missing something. Where are the other two files?

TL;DR
The user is having an issue where the `listFiles` function in the web client SDK is only returning 25 files even though there are 27 files total in the specified bucket. The solution is to adjust the `Query.limit` value to a higher number, such as `[Query.limit(100)]`, to explicitly specify how many files to retrieve.
safwan
3 Aug, 2023, 12:10

This is because of the default Query.limit value, which is set to 25. You can explicitly mention how many items you want, by using Query.limit(100) or something like that.

TypeScript
const promise = storage.listFiles(
  '[BUCKET_ID]', 
  [ Query.limit(100) ]
);

Reference: https://appwrite.io/docs/queries

safwan
8 Aug, 2023, 20:22

[SOLVED] listFiles returns only 25 files

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more