Back

Images into the database?

  • 0
  • Databases
  • Web
  • Cloud
Mr English
14 Jun, 2024, 18:07

In my blog application, I have a form for adding posts to the database. The form contains a Quill text editor. The editor content is saved in a string attribute called 'body'. The size of the body attribute is set to 1000000. This works fine - all the text formatting works. Unfortunately, if I add an image to the editor I get this error - "PayloadTooLargeError: request entity too large". I know that there is a section in the docs called Storage. I have not read that yet, but I will. However, my question is, is it actually possible to drop images into an editor and them save into the database?
Thanks.

TL;DR
It is not recommended to store images directly in the database. Consider using a storage service instead. If you encounter a "PayloadTooLargeError," it means the request entity is too large. Make sure to read the Storage section in the docs.
Steven
14 Jun, 2024, 18:55

You should not be storing images in database. You should use the storage service

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