Category: How do I do X?
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

How to save image from camera to sqlserver

Issue

I am having trouble figuring out how to save an image from .imageBlobURL to SQL server using JavaScript. I tried fetching the blob object, but it didn't work. Someone suggested that I save the base64 of the image instead of the blob, which worked well. The imageDataURL property gave me the base64, and I saved it to the database as a complete base64 image string.

Resolution

The problem was that the user was having difficulty saving an image from a camera widget to SQL server. They had tried to fetch the blob object using JavaScript but were experiencing problems. Another user suggested that they save the base64 of the image instead of the blob and to use the imageDataURL property to obtain the base64 string.

The user then asked how to use the obtained string to create an image and was provided with a link to a sample app for reference. The user finally realized that they were overthinking the problem and were pleased to discover that simply saving the imageDataURL to the database resulted in the complete base64 image string being saved.