It looks like the issue is that the metadata and base64 of the image is separated. The current workaround is to use something like this to re-assemble the two:
Hi @Soheil_Ebrahimi! Would you mind sharing a screenshot of your current query? And if you could also click into the field (where you're passing in the fileButton files and values) to bring up the little green preview box and share a screenshot, that would be super helpful.
Hi Michael! That should be all you need - the ...(spread operator in Javascript) brings out the key value pairs from the files object and allows them to be joined with the data key. Is this not working for you?
Hi Victoria,
the term added to the "Attachments" property of a SMTP query is not working. When I hover over it I get several error messages:
"Expected an identifier and instead saw '...'"
"Missing semicolon"
"Expected '}' to match '{' from line 1 and instead saw ':'"
And to double check, do you know if you're using the new file button or the older one? We can confirm via a screenshot of the right panel to show the file button properties (the newer button has a different set of customizable properties), or even better, your left panel, expanded out to show the data structure of your file button.
Do you know what file structure your resource is expecting from the Attachment field? General API file types expect the below format:
{
name:
size:
lastModified:
type:
data:
}
and you can make that happen by placing {{ {...fileButton1.files[0], "data": fileButton1.value[0] } }} directly in the field!
Most of the googling suggests using a javascript file input stream to stream it to the google cloud storage bucket but that doesnt seem possible from what I understand through retool.
Hi @mikalw! Interesting. So the upload connection is working, but it must not be uploading the right data. I just learned we have a bug around GCS + JSON uploads this morning, so perhaps this is related. For this bug, the workaround would be to manually define the content type as 'application/json' and stringifying the JSON data to be passed in.
Does this sound related at all? Do you know what data has been uploaded by any chance, aside from just the file size?