Hi,
I’ve got a problem.
I send datas to my collections from iOS Shortcuts and Zapier (JSON with Webhooks).
No problem for text datas.
But for images, I only can send the URL.
Images are displayed in Wix, but I want to send the image file, to be hosted by Wix.
In iOS Shortcuts (my trigger), I can encode image in Base64.
How to decode it to be hosted by Wix please?
I am using the code below for now:
'use strict';
import {ok, response, serverError, badRequest} from 'wix-http-functions';
import wixData from 'wix-data';
export function post_addthings(request) { // POST = Method
return request.body.json()
.then(body => {
let recordInsert = {
"title": body.title,
"description": body.description,
"source": body.source,
"image": body.image,
};
return wixData.insert('Database', recordInsert)
.then(result => ok({body: JSON.stringify(result)}))
.catch(err => response({status: 500, body: err}));
}
);
}
Thanks for your help