You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to handle images via your API. I can read the API fine and get a URL to the image but trying to create a new image via a POST request doesn't seem possible?
I have my image in base64 format but not sure how to post this to the API?
I assume this isn't built in behaviour so I need to upload it via a custom ACL method? Do you have an example for how I create a custom method?
Thanks
The text was updated successfully, but these errors were encountered:
It isn't built in at the minute... there is a plan for something like this to be included but not sure of the best way yet...
For now you got 2 options:
Create a new route to a special controller like upload: UploadController, which will handle the file upload and return a File ID.
Or use the new onBeforeDeserialize or onAfterDeserialize hooks, to catch your Base64 encoded file. So you could have your Base64 data in a json key like "rawFile": "018dar...", in the onAfterDeserialize grab the Base64 data and create a File, then remove the rawFile key and add a FileID to the deserialized payload
Hi
I am trying to handle images via your API. I can read the API fine and get a URL to the image but trying to create a new image via a POST request doesn't seem possible?
I have my image in base64 format but not sure how to post this to the API?
I assume this isn't built in behaviour so I need to upload it via a custom ACL method? Do you have an example for how I create a custom method?
Thanks
The text was updated successfully, but these errors were encountered: