Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enhance listFiles api to return additional fields #899

Open
1 task done
kuizuo opened this issue Jul 31, 2024 · 3 comments
Open
1 task done

feat: enhance listFiles api to return additional fields #899

kuizuo opened this issue Jul 31, 2024 · 3 comments
Labels
✨ enhancement suggestion or feature request to improve uploadthing planned We would like this to happen

Comments

@kuizuo
Copy link

kuizuo commented Jul 31, 2024

Describe the feature you'd like to request

I noticed that the files in the dashboard show size and uploaded.

image

but listFiles api doesn't have.

import { utapi } from "~/server/uploadthing.ts";
 
const files = await utapi.listFiles();
 
console.log(files);
/*
 * [
 *  {
 *    id: "7099d109-39ec-43fe-a887-4a4fd87cad88 ,
 *    customId: null, // whatever you set it to when uploading
 *    key: "2e0fdb64-9957-4262-8e45-f372ba903ac8_image.jpg",
 *    name: "image.jpg",
 *    status: "uploaded",
 *  }
 * ]
 */

Describe the solution you'd like to see

I want to use the metadata field to return this additional information. And through an option in the request body to decide whether to output

Additional information

No response

👨‍👧‍👦 Contributing

  • 🙋‍♂️ Yes, I'd be down to file a PR implementing this feature!
@kuizuo kuizuo added the ✨ enhancement suggestion or feature request to improve uploadthing label Jul 31, 2024
@markflorkowski markflorkowski added the planned We would like this to happen label Aug 5, 2024
@markflorkowski
Copy link
Collaborator

We kind of expect you to store that information in your own DB, listFiles being more of a backup method, hence why it does not return much info.

That said, after talking with the team, we are considering adding additional info to the return from this API. Do note however, we will likely be rate-limiting requests to this endpoint, as we still want to encourage storing this information on your own DB.

@SrBrahma
Copy link

@markflorkowski, would you recommend a simple cloud DB with a similar very easy setup for this info?

@r0ld3x
Copy link

r0ld3x commented Sep 11, 2024

@markflorkowski, would you recommend a simple cloud DB with a similar very easy setup for this info?

you can use supabase they provide PostgreSQL which is so easy to setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement suggestion or feature request to improve uploadthing planned We would like this to happen
Projects
None yet
Development

No branches or pull requests

4 participants