Back

Bucket to database

  • 0
  • Databases
  • React Native
  • Storage
Taussy10
26 Dec, 2024, 11:34

So , have a bucket in which store media then from that I want to store those media into database. storing things in database is working bu don't know why nothing is adding in the databae can someone help

TL;DR
The developer is trying to store media files in a database but is facing issues with items not being added to the database. They are advised to store the URL of the uploaded file instead of the entire file. To resolve the issue, they should modify the code in the upload file to return the file URL instead of the whole result.
Darshan Pandya
26 Dec, 2024, 12:22

whats the error? and what do you mean by - I want to store those media into database. Are you trying to save the media file itself or some info. about it?

Mingu
26 Dec, 2024, 14:53

I think he want to store the link of the file

Axistro
26 Dec, 2024, 14:54

hope you are following the jsmastery video . so in the code you are trying to store the whole thumbnail and video onto database , but what you should save is the url of that item. so in the upload file instead of returning the whole result do this const fileUrl = await getFilePreview(uploadedFile.$id, type); return fileUrl; this returns the url of the file uploaded

Axistro
26 Dec, 2024, 14:56
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