I uploaded an image to cloud storage with a JSON Schema Form on Retool:
This is the JSON Schema:
{
"type": "object",
"properties": {
"image": {
"type": "string",
"format": "data-url",
}
}
}
This is the image I uploaded:
Then, I could upload the image successfully with the query settings:
This is the uploaded image on cloud storage:
However, on cloud storage, when opening the "Object details" of the image, the image was not displayed:
Moreover, when opening the Authenticated URL of the image, the image also was not displayed:
Are there anything missing for what I've done?
This code for "Upload data" contains not just the "Image Data" but also other data like the "Content-Type", the "File Name" and the "Encoding Schemes":
{{ form.data.image }}
So you need to extract only the "Image Data" with this code:
{{ form.data.image.split(',')[1] }}
In addition, for "Upload file name",
You can extract the "File Name" "orangeHoney.jpg" as well with this code:
{{ form.data.image.split("name=")[1].split(";")[0] }}
This is the uploaded image on cloud storage uploaded with the 2 sets of code above:
Then, on cloud storage, when opening the "Object details" of the image, the image was displayed:
Moreover, when opening the Authenticated URL of the image, the image also was displayed: