How do i send a file through api

Gravatar

After creating the database and generated the backend...etc the api documentation doesn't show how to send a file to the api

since the api only take raw json data, there is no way to send image

is there any way to upload image using the api to a database generated ?

User profile image
Colin Doylend mod

Hi @Yousef!

Thanks for your question.

Hello there!

I believe you will be able to see the mechanism within the source code. I.e. you can create an entity with the field of image or file type and see how it is implemented.

Our engineers will follow up with more details soon

Gravatar

Thank You for your answer,

here is more details in my database i have a "categories" table which takes title->string image->photo

in the api i only got documentation for the strings fields to send as JSON object

{ "data": { "title": "title" } }

now with this method i can't send an image file i tried sending Base64 image, and i tried to send formData and still no luck is there a possible way to do so ? or it's gonna require more coding in the source code if so can you guide me through it ?

Thank You

User profile image

We use FormData to upload files. You can see the details in the file

src/components/FormItems/uploaders/UploadService.js And thanks, we'll see what's wrong in the api documentation.

Gravatar
Yousef Alsbaihi

Thank you Alexandr,

i will purchase a paid plan and see how it goes but my issue was with API where it asks me to send JSON data as api post but you can't send image as JSON data

i'll take a look at it and get back to you.

Cookie Consent

By continuing to browse or by clicking 'OK', you agree to the storing of cookies on your device to enhance your site experience and for analytical purposes. To learn more about how we use cookies, please see our cookies policy.